jump bug

Blitz3D Forums/Blitz3D Beginners Area/jump bug

Ruz(Posted 2003) [#1]
I have just about finished stting up my demo now.the only problem remaining is the glitch where wheh you continously press the jump key the player keeps on jumping higher.
how do I stop the key being pressed while the player is off the ground.
I thought about limiting the height of the player using entitydistance , but since my level is not a flat plane it won't work.
or something like
If not entitycollided(mesh,level_collision)then Keyhit(57)=False

This is probably dumb, but least i am trying


bazziman(Posted 2003) [#2]
You need a 'flag' (that's a variable telling you that the person is allready jumping).


ronbravo(Posted 2003) [#3]
I would probably do the second thing you mentioned where I would have a variable that only let the player jump if they were touching the ground. Basicly the same thing Bazziman was saying.


Ruz(Posted 2003) [#4]
I have tried all sorts of stuff, still buggin me.


Ross C(Posted 2003) [#5]
Will just set a flag when the player is not colliding with the ground. then say.

If EntityCollided(player,2) and jumpflag=0 then
          do_jump()
end if



Ruz(Posted 2003) [#6]
cheers joker,I will try that.
i don't want to jump over any flags though, he he


Ruz(Posted 2003) [#7]
Unfortunately entity collided doesn't seem that reliable a way to do this. Its because my level is all one mesh and there is no ground as such. it means the ground includes the walls/buildings
Is there anyway to specify a collison with a surface?


Zephar123(Posted 2003) [#8]
best way to make the surfaece one collisiions is as so.

make your ground mesh let say a collision of2 ok
all your buildings should be a collisions of 3.
now make your player a collision type of 1
now you have different collisions checks for ground and buildings.
collisions 1,2,2,2
collisions 1,3,2,2

Now this creates another problem ill have to think about. Which is if you are inside the building :(


Ruz(Posted 2003) [#9]
nice idea, but the buildings and ground are all one mesh .
I think my best bet for now is to have certain jump areas, otherwise you can't jump at all.Really there is no point jumping anyway unless there is some item to jump for.
With this method you don't have to press a key to jump, just get near to a a particular entity.
if anyone has a better solution I would be grateful.


Ross C(Posted 2003) [#10]
ok then, how about as soon as the player jumps, set a value, then do a linepick downwards. Then get a distance. if the distance is less than say 0.1 then clear the flag and allow the player to jump. how bout that?


Ice9(Posted 2003) [#11]
Yes I do mine like
if jump key pressed
if linepick 5 units below the player feet <>0 then jump


Ruz(Posted 2003) [#12]
guys i haven't looked at line pick commands yet, but will have a go at this on monday, cheers.


Ruz(Posted 2003) [#13]
just noticed there's some jump code in the archive by bradford 6. will still check out the line pick stuff though,I want to learn.