Increasing height
Posted: Fri Aug 19, 2011 4:40 am
Hi
This isn't an 'advanced game topic' but it is for game programming. I'm testing out this 2D game i'm creating and i've been stuck with this problem for hours now.
My player can jump in the game but every time he does , his y co-ordinate increases by about 10 pixels and i'm sure it's a simple error to you but not to me. Why is this happening?
This isn't an 'advanced game topic' but it is for game programming. I'm testing out this 2D game i'm creating and i've been stuck with this problem for hours now.
My player can jump in the game but every time he does , his y co-ordinate increases by about 10 pixels and i'm sure it's a simple error to you but not to me. Why is this happening?
Code: Select all
If Player\jumping=1
Sprite\row=13
Sprite\frames=3
Sprite\delayed=8
Player\y-Player\jumph
If Player\jumph<=0
Player\jumph=0
EndIf
If Sprite\timer=32
Sprite\timer=0
Player\jumping=0
Player\jumph=0
Player\jump=1
EndIf
If Player\jumph>=1
Player\jump=0
EndIf
Debug Player\y
If Player\jumph<=1 And Player\jump=1
Player\jumph+0.1
Else
Player\jumph-0.1
EndIf