How to fix my jumping in a platformer?
Dylan84
Member Posts: 12
I'm making a platformer and I followed Jamie Cross's "Basic Platformer movement" tutorial on YouTube to set up the keys to go left, right and jump. My problem is when I jump I can use the left & right buttons and go for a very long time as if I was just walking in the air. The gravity/accelerate down will eventually bring be to the ground but it takes far too long. I would still like for my player to be able to move left & right during jumps just a little bit to get onto platforms and such, but not anywhere close to as long as it is. I DMd Jamie on here to see if he could help but I guess he hasn't been on. Doe's anyone know what I need to do? Thanks!
Comments
Are you using the move behavior ? right and left ?
@Icebox yes using move to go right & left
Use change attribute instead
if both right and left keys are up change attribute self.motionlinearvelocityx to 0
if right key is down
change attribute self.motionlinearvelocityx to 200(speed) (+ is right)
if left key is down
change attribute self.motionlinearvelocityx to -200(speed) (- is left)
or you can use constrain attribute , if you see any bug with the change attribute change it to constrain , test it and goodluck
I wanted to edit and upload a file but i couldnt , I attached a platformer demo.It has moving right and left , spawning bullets , jumping and enemy movements, hope it helps and good luck
@Icebox thanks alot man!
@Icebox where is that attribute? cant find it
@dbell You create the attribute yourself , I think you need to watch these videos first to get an idea of GS, by gamesalad guru or watch other tutorials on youtube.