Jumping
Blitz3D Forums/Blitz3D Programming/Jumping
| ||
Could anyone tell me how to create a jump effect? Thanks..... |
| ||
This is typed straight into the codebox, but it might work :) |
| ||
thanks :) |
| ||
replace if keyhit(57) player_speed_y = 1.0 endif -with- If player_y#=0 If KeyHit(57) player_speed_y = 1.0 EndIf EndIf it doesnt allow you to jump while your in the air, but it would only be useful if ur level is flat...which i think urs is "no enemies"? for ur cylinder shooter? |
| ||
yes....it is flat. But isn't there a command like, FindHeight or something? |
| ||
If player_y#=0 How likely is it that y# will equal exactly zero in a floating point system? To be on the safe side I'd check to see if it is less than a small height rather than equal to zero or, better still, check for an actual collision with the floor before allowing a jump. |
| ||
Collisions! Obviously!If EntityCollided(player,ground) If KeyHit(57) player_speed_y = 1.0 EndIf EndIf |