This is an Test.
Controls:
Arrow LEFT/RIGHT : Move
Arrow UP : Jump
Jump again in air : Double-Jump
P#19383 2016-03-24 10:14 ( Edited 2016-03-24 16:16)
:: Skyrunner65
Good! A few notes:
- Instead of simply adding the player's x or y for a bit, try this:
dx = 0 dy = 0 jump = 2 |
- Let's work on moving.
if(btn(0,0))then dx = -1.5 elseif(btn(1,0))then dx = 1.5 else if(dx > 0)then dx -= 0.5 end end x = x + dx |
- While we're doing it, let's jump too!
if(btn(4,0)) or (btn(5,0)) then if(jump > 0)then dy += 5 jump -= 1 end end if(y > 120)then dy -= 0.5 else dy = 0 y = 120 jump = 2 end y = y + dy |
Brand new code!
P#19385 2016-03-24 12:16 ( Edited 2016-03-24 16:19)