jumping

BlitzPlus Forums/BlitzPlus Beginners Area/jumping

Linus(Posted 2012) [#1]
i have worked on a basic game but i cant get the jumping right. Does anyone have any suggestion?


Yasha(Posted 2012) [#2]
What's going wrong with it?


indietom(Posted 2012) [#3]
This is not real code but just do.

if touch floor and keypress space then playerY -= 10


indietom(Posted 2012) [#4]
This is not real code but just do.

if touch floor and keypress space then playerY -= 10


Hotshot2005(Posted 2012) [#5]
You used Cos or sin maths to make the player Jump I think

Last edited 2012


Midimaster(Posted 2012) [#6]
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)



Linus(Posted 2012) [#7]
thanks that solved my problem