-- title: quickplat
-- author: game developer
-- desc: quick platforming tests
-- script: lua
t=0
x=96
y=24
local airAccel = 0
local airControl = 0
local airBrake = 0
local runAccel = 0.2
local runTurnSpeed = 0
local runDecel = 0.2
local runMaxSpeed = 1
local cameraDampX = 0
local cameraDampY = 0
local cameraLookAhead = 0
local jumpBufferTime = 0
local jumpMaxFallSpeed = 5
local jumpCoyoteTime = 0
local jumpMaxHeight = 20
local jumpVariableHeight = true
local jumpGravity = 0.7
local player = {
x = 10, y = 80,
vx = 0, vy = 0,
jump = 2.3,
}
local gravity = -0.07
function TIC()
movePlayer()
cls(0)
drawPlayer()
t=t+1
end
function movePlayer()
-- if btn(0) then player.y=player.y-1 end
-- if btn(1) then player.y=player.y+1 end
if btn(2) then
player.vx = math.min(-runMaxSpeed, player.vx - runAccel)
end
if btn(3) then
player.vx = math.max(runMaxSpeed, player.vx + runAccel)
end
if player.vy == 0 and btnp(4) then
player.vy = -player.jump
end
-- friction and gravity
player.x = player.x + player.vx
player.vx = player.vx * runDecel
player.vy = player.vy - gravity
player.y = player.y + player.vy
if player.y > 130 then
player.y = 130
player.vy = 0
end
end
function drawPlayer()
rect(player.x, player.y, 8, 8, 7)
end
--
-- 001:5555555566666666222222222222222222222222222222222222222222222222
-- 002:5555555066666665222222262222222022222220222222202222222022222220
--
--
--
-- 000:00000000ffffffff00000000ffffffff
-- 001:0123456789abcdeffedcba9876543210
-- 002:0123456789abcdef0123456789abcdef
--
--
-- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
--
--
-- 000:00202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
--
--
-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
--