Here you go. This is Jump code at its simplest
Replace the image with anything. :)
' Jump Code for Kaisuo ' By AMon SuperStrict Graphics 800 , 600 Global Dude:TImage = LoadImage("dude.png") Global Jump:Int = 0 ' Tracks whether we can jump Global Gravity:Float = 0.3 'Gravity applied to jumpheight Global JumpHeight:Float = 7 ' How High we can jump Global dudeX:Float = 380 Global dudeY:Float = 520 While Not KeyHit(KEY_ESCAPE) Cls DrawImage Dude, DudeX , dudey , 0 DrawLine 0 , 570 , 800 , 570 If KeyHit(KEY_SPACE) Jump = 1 End If DoJump() If dudeY >= 570 - 50 dudeY = 570-50 Jump = 0 JumpHeight = 7 End If Flip Wend Function DoJump() If Jump = 1 dudeY:-JumpHeight JumpHeight:-Gravity If JumpHeight <=-5 Then jumpHeight = -5 End If End Function
Replace the image with anything. :)