You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
176 lines
13 KiB
176 lines
13 KiB
pico-8 cartridge // http://www.pico-8.com
|
|
version 32
|
|
__lua__
|
|
-- game code
|
|
|
|
function init_world()
|
|
player = {}
|
|
player.x = 60
|
|
player.y = 112
|
|
player.vy = 0
|
|
player.flipx = false
|
|
player.spr = 0
|
|
player.moves = 0
|
|
end
|
|
|
|
function _init()
|
|
-- disable btnp autorepeat
|
|
poke(0x5f5c, 255)
|
|
|
|
-- set peach as bg color
|
|
-- instead of black
|
|
palt(black, false)
|
|
palt(peach, true)
|
|
|
|
init_world()
|
|
end
|
|
|
|
function _update()
|
|
update_player()
|
|
end
|
|
|
|
function _draw()
|
|
cls(12)
|
|
camera_x = mid(0, 896, player.x - 64)
|
|
camera(camera_x, 0)
|
|
draw_bg()
|
|
draw_player()
|
|
camera(0, 0)
|
|
print_ctr("b o r b",8,yellow)
|
|
end
|
|
|
|
function draw_bg()
|
|
map(0, 0, 0, 0, 128, 16)
|
|
end
|
|
|
|
function update_player()
|
|
if (btn(0)) then
|
|
player.x -= 1
|
|
player.moves += 1
|
|
player.flipx = true
|
|
end
|
|
if (btn(1)) then
|
|
player.x += 1
|
|
player.moves += 1
|
|
player.flipx = false
|
|
end
|
|
if (btnp(🅾️)) then
|
|
player.vy = -5
|
|
player.jumping = true
|
|
end
|
|
player.y += player.vy
|
|
player.vy += 0.5
|
|
if (player.y > 112) then
|
|
player.y = 112
|
|
player.vy = 0
|
|
player.jumping = false
|
|
end
|
|
player.spr = (player.moves / 3) % 3 + 1
|
|
if (player.x < 0) player.x = 0
|
|
if (player.x > 1016) player.x = 1016
|
|
end
|
|
|
|
function draw_player()
|
|
spr(player.spr,player.x,player.y,1,1,player.flipx)
|
|
end
|
|
|
|
-->8
|
|
-- library
|
|
|
|
black = 0
|
|
dark_blue = 1
|
|
dark_purple = 2
|
|
dark_green = 3
|
|
brown = 4
|
|
dark_gray = 5
|
|
light_gray = 6
|
|
white = 7
|
|
red = 8
|
|
orange = 9
|
|
yellow = 10
|
|
green = 11
|
|
blue = 12
|
|
indigo = 13
|
|
pink = 14
|
|
peach = 15
|
|
|
|
function print_ctr(s,y,c)
|
|
print(s,64 - #s * 2,y,c)
|
|
end
|
|
__gfx__
|
|
00000000ffff00ffffff00ffffff00ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000fff0880ffff0880ffff0880f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000ffff800fffff800fffff800f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000fff0800800008008fff08008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000ff08888ff888888fff08888f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000f088888fff88888ff088888f000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000088888fffff888ff088888ff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000fff4f4fffff4f4ffff4f4fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
4444444444444444ff4444ffff4444ffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
4444444444444444ff4444ffff4444ffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
1444444144444411ff4444ffff4444ffffffffffffffffffffffffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
1114411111441111ff4444ffff4444fffffff33ff33ff33ff33fffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
1111111111111111ff4444ffff4444fffff333333333333333333fff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
1111111111111111f444444fff4444ffff33333333333333333333ff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
1111111111111111f444444fff4444fff3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
1111111111111111f444444fff4444fff3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff4444fff3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff4444ff333333333333333333333333000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff4444ff333333333333333333333333000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff0444fff3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff0444fff3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff4444ff333333333333333333333333000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff4444ff333333333333333333333333000000000000000000000000000000000000000000000000000000000000000000000000
|
|
000000000000000000000000ff4444fff3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000f3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000f3333333333333333333333f000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000ff33333333333333333333ff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000fff333333333333333333fff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000fffff33ff334433ff33fffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000ffffffffff4444ffffffffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000ffffffffff4444ffffffffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
00000000000000000000000000000000ffffffffff4444ffffffffff000000000000000000000000000000000000000000000000000000000000000000000000
|
|
__gff__
|
|
0000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
__map__
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000004445460000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000005455560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000005455560000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003
|
|
0000000000000000006465660000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003
|
|
0000000000000000000043000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000053000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
0000000000000000000042000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
|
4040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040404040
|