jumping
BlitzPlus Forums/BlitzPlus Beginners Area/jumping| 
 | ||
| i have worked on a basic game but i cant get the jumping right. Does anyone have any suggestion? | 
| 
 | ||
| What's going wrong with it? | 
| 
 | ||
| This is not real code but just do. if touch floor and keypress space then playerY -= 10 | 
| 
 | ||
| This is not real code but just do. if touch floor and keypress space then playerY -= 10 | 
| 
 | ||
| You used Cos or sin maths to make the player Jump I think Last edited 2012 | 
| 
 | ||
| you are writing to less to find out, what your problem is. Please write more. If your problem is, that the actor does not return to floor, use gravity: Graphics 800,600 PlayerY#=300 PlayerX#=0 Gravity#=.1 Repeat Cls Line 0,330,800,330 Oval PlayerX,PlayerY,30,30 PlayerX=PlayerX+2 PlayerY=PlayerY+ Gravity If PlayerY>300 Then PlayerY=300 Gravity=0 Else Gravity=Gravity+.5 EndIf If KeyHit(57) Gravity=-10 EndIf Flip Until KeyHit(1) | 
| 
 | ||
| thanks that solved my problem |