123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104 |
- -- 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
- -- <TILES>
- -- 001:5555555566666666222222222222222222222222222222222222222222222222
- -- 002:5555555066666665222222262222222022222220222222202222222022222220
- -- </TILES>
- -- <MAP>
- -- 015:101010101010101010101010101010101010101010101010101010101010000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
- -- </MAP>
- -- <WAVES>
- -- 000:00000000ffffffff00000000ffffffff
- -- 001:0123456789abcdeffedcba9876543210
- -- 002:0123456789abcdef0123456789abcdef
- -- </WAVES>
- -- <SFX>
- -- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
- -- </SFX>
- -- <FLAGS>
- -- 000:00202000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
- -- </FLAGS>
- -- <PALETTE>
- -- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
- -- </PALETTE>
|