Jumping Issue..(SOLVED)

grimtoothgrimtooth Member Posts: 69
edited May 2013 in Working with GS (Mac)
LOL somehow typing out my question led me to answer it on my own, but I will still post this with the hope that maybe it could help someone else i guess!

Yay! more Newbie Questions...

I wanted to remove the possibility (for now) of players jumping off of vertical walls or in mid-air after dropping off of a platform, So I built my jump routine as follows.

Jumps=Actor Attribute (Integer)

Jump (key)
-Accelerate at 90 degrees with value 600
-change attribute "Jumps" to 0

Fall
-IF actor Linear.motion.Y < 0
-change attribute "Jumps" to 0

Land
-IF Actor Linear.motion.Y=0
-change attribute "Jumps" to 1

This works fine for testing at first but after running around and jumping for a while it eventually breaks and the actor will not jump anymore.

SOLUTION: apparently "Actor Linear.motion.Y < 0" was too tight a tolerance... changing the 0 to -10 solved the problem immediately.

Warning to self and others... this setup will cause the actor to be unable to jump while running down slopes, although there may be a happy place around "Actor Linear.motion.Y < -100" that will still work.

I know you all would have answered that for me so theoretical thank you's all around!
Grim

Comments

  • grimtoothgrimtooth Member Posts: 69
    hmmm... dang... it is extremely hard to do (but possible after more testing) but the linear.velocity.Y=0 in the land function is true for a split second at the peak of a jump allowing for double, triple, quadruple etc.. jumping...

    I guess my alternative to collision rule jump resetting has its own fun flaws
  • jamie_cjamie_c ImagineLabs.rocks Member, PRO Posts: 5,772
    Hi @grimtooth, I'm not sure if it will fit your needs or not but I have a tutorial here about movement and jumping in a platformer style if you're interested in checking it out.

    http://www.jamie-cross.net/?portfolio=gamesalad-recipe-004-advanced-platform-character-movement-featuring-double-jumping
  • grimtoothgrimtooth Member Posts: 69
    @jamie_c Thanks for the reply! .. I had found a dead link to that very same tutorial in google but was unable to read the actual article lol.

    I had tried the above method of using the linear Y velocity rather than collide rules because in my first build the collide rules kept breaking and ending up with 0 jumps to use while standing on the floor. Also i wanted to try it partly because in the template I am building for myself all vertical and horizontal walls are the prototype actor. I understand that it would be pretty easy to just redo the walls but I wanted to try something else because I kept ending up with 0 jumps left.

    In the end it was probably me just missing something since I had not at the time read your great tutorial :)

    Thank You!
Sign In or Register to comment.