Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411430 Posts in 69363 Topics- by 58416 Members - Latest Member: JamesAGreen

April 19, 2024, 10:23:06 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsCommunityDevLogsThe Batman Game I Made While Waiting For Batman Arkham City To Release On the PC
Pages: 1 [2]
Print
Author Topic: The Batman Game I Made While Waiting For Batman Arkham City To Release On the PC  (Read 5825 times)
Armageddon
Level 6
*



View Profile
« Reply #20 on: October 24, 2011, 12:28:16 PM »



Yeah I don't know.
Logged

Jawnsunn
Level 0
***



View Profile
« Reply #21 on: October 24, 2011, 03:48:26 PM »

The Grandma Engine is really nice. Thought when I disabled double jump I keep infinite jumping, not sure why. I've got lots to do! Animations with code is gonna be interesting.  Smiley Still haven't tried the grapple code.
If you tried putting the variable candj to false, it really doesn't disable the double jumping.
Comment out this piece of code on the obj_player's step event:
Code:
  //Double jumping
/*    if (keyboard_check_pressed( key_jump ) && candj) {
        candj = false;
        vspd = S_DJUMP_SPEED;
    }*/
I think that does the trick.

PS:I have no idea how you got the infinite jumping.
Logged
Armageddon
Level 6
*



View Profile
« Reply #22 on: October 24, 2011, 04:49:47 PM »

Oh thanks, it worked! Now to figure out animation, and make a tile set. Tongue
Logged

C.D Buckmaster
Level 7
**


Death via video games


View Profile
« Reply #23 on: October 24, 2011, 07:25:46 PM »

Luckily GML is basically made for retards, so it shouldn't be too hard for you to pick up.

This is totally going to be my signature now  Big Laff.
Logged
ink.inc
Guest
« Reply #24 on: October 24, 2011, 10:49:09 PM »

yo dawg i herd you like batman

Download BATMAN from Host-A

i helped you out with some shit and did some other shit

(yeah i was bored)

things i added:

i did the grappling mechanic for you
ledge grabbing (when next to a ledge object, press up to climb up on it)
basic camera shit (can be edited in the room editor, under views)
draw that icon on the nearest ledge



have fun

 Cool
Logged
Armageddon
Level 6
*



View Profile
« Reply #25 on: October 24, 2011, 10:56:32 PM »

Thank you so, so, so much. This is perfect. You will defiantly have credit for this. I can't thank you enough. Beer!
Logged

ink.inc
Guest
« Reply #26 on: October 24, 2011, 10:59:14 PM »

i accept all my credit with defiance
Logged
ink.inc
Guest
« Reply #27 on: October 24, 2011, 11:18:22 PM »

How it works:

Basically, the player has 3 states:

standard running/jumping
leaping to ledge with grappling hook
ready to climb ledge with hands

when in each of these states, it locks him out of all the other states

so when you're using your grappling hook, you cant jump (or modify your hspd/vspd with your keys) and when you're ready to climb the ledge, you stop moving entirely

these states are labeled thusly:

(unlabeled)
move_to_ledge
grab_left/grab_right

i modified the way ledge grabbing works so that it uses matt thorson's variables, as opposed to gm's built in ones

this way, you won't be jumping through walls, and will maintain perfect collision detection, as provided by the grandma engine

basically it works like this:

when the player presses X in midair, it checks the difference of x coordinates of the player and nearest_ledge, as well as the difference in y coordinates

then move_to_ledge is set to true

when this is set to true, the player will move to the ledge within 5 frames, with a hspd of x_dist/5 and a vspd of y_dist/5 (each frame will move the player 1/5th of the distance to the ledge)

as for ledge grabbing

the game merely checks for ledge objects to the left/right of the player

if there is one, the game sets the player's state to grab_left/grab_right, and from there the player will have to press up to climb up the ledge (you will want the player to have the option to drop from the ledge, i didnt code that in there)

so yeah thats how it works

PS: Note that any code that is written up for you on the internet is generic code. You need to be able to understand how the example code works, and be able to re-implement it into your specific engine. I saw a lot of copypasta in the work you posted, most of which was redundant and unnecessary. For example, you had BOTH move_to_point functions that I wrote up, when the second one was merely  the first one, but with speed that grew smaller the closer the player got to the ledge.
« Last Edit: October 24, 2011, 11:27:13 PM by John Sandoval » Logged
ink.inc
Guest
« Reply #28 on: October 25, 2011, 08:49:45 PM »

Hello, so I was wondering if you could help me again. Sad I got animations to work, I have it so when you press down you drop off ledges and I made it so that only when you are in the air an icon appears but I noticed five things I tried to fix but can't figure out a practical way to do it.


1. The grapple icon flips when the player changes direction.


2. Right now you can grapple from above and under neath but I'd really like something like this.



I know I would need two ledge objects, but I think that's good because the right ledge icon is positioned wrong. So I could fix it. But I didn't know if this would affect ledge grabbing.


3. How do you set animation framerate? Right now my running animation is way too fast. I'm using sprite_index.


4. When you hang from a ledge I'd like to be able to move the player into a certain position so I can have a ledge hanging animation, and then a ledge climb animation when you press up.



5. How do I change the color of the drawn line? I looked for a function and couldn't find any. Also how do I give the jump sprite a separate origin just for the rope? So that it comes out of his hand.


Thanks! Gentleman

1. ya i fucked that up in the draw event. in the function that states draw_sprite_ext, put in 1 instead of image_xscale, so that it doesn't flip.

2. in the grappling code, put in a limit that prevents you from grappling if you are lower than the ledge

you can do it with

if nearest_ledge.y<self.y
{
//
}

3. image_speed = 1 //1 = max, .5 = 50 percent

4. make the player sprite invisible, and create an object whose only purpose is to draw the climbing animation. when the animation is done, destroy the object and make the player object visible again (and then it should be in the proper coordinates).

EDIT: TO SET THE POSITION OF THE PLAYER OBJECT

get the x and y coordinates of nearest ledge and set the player coordinates accordingly

for example

with nearest_ledge
{
oPlayer.x=self.x+10
oPlayer.y=self.y
}

5. draw_line_color() //i think

For the most part, with the exception of number 4, these were fairly easy questions. If you need more help like this, just press F1 to access the help menu. More often than not, you'll get an answer in 2 seconds, as opposed to waiting X hours for someone to respond on TIGS.
« Last Edit: October 25, 2011, 09:37:35 PM by John Sandoval » Logged
Armageddon
Level 6
*



View Profile
« Reply #29 on: October 26, 2011, 04:30:53 PM »

Thank you again!

The grapple icon is now fixed. I'm not exactly sure where to put the grappling code though? Image animation is working well. Grapple wire is now blue. I found a way to make the wire look like it's coming out of his hand the problem is when you face the opposite direction it doesn't flip the coordinate, I tried.

Code:
if move_to_ledge=true
{
if hsvp<-1
{
   draw_line(x-12,y+4,nearest_ledge.x,nearest_ledge.y)
}
}

But this caused a lot of problems. I still need to make a left ledge object.


Looks like he's snaking up the ledge. Tongue

I'm going to try and make the climbing now. WTF
Logged

negativeview
Level 0
***


View Profile
« Reply #30 on: October 26, 2011, 04:32:32 PM »

This is brilliant. Awesome first project! (I think I read this was your first real coding project, right?)
Logged

ink.inc
Guest
« Reply #31 on: October 26, 2011, 04:33:26 PM »

You spelled hspd wrong in your code...
Logged
Jawnsunn
Level 0
***



View Profile
« Reply #32 on: October 26, 2011, 04:41:21 PM »


You can probably use this as a reference.
From the Trixie Treasure Devblog.
Logged
Armageddon
Level 6
*



View Profile
« Reply #33 on: October 26, 2011, 05:11:46 PM »

You spelled hspd wrong in your code...
Woops, I was rewriting it from memory. I got it to work now.

Yes negativeview, this is my first project. Thanks! Grin

Thanks for the reference Jawnsunn, I'm gonna have to remake my animation.
Logged

ink.inc
Guest
« Reply #34 on: December 21, 2011, 09:56:37 AM »

i am disappoint
Logged
Pages: 1 [2]
Print
Jump to:  

Theme orange-lt created by panic