diff --git a/borb.p8 b/borb.p8 new file mode 100644 index 0000000..6428e80 --- /dev/null +++ b/borb.p8 @@ -0,0 +1,136 @@ +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() + palt(black, false) + palt(peach, true) + init_world() +end + +function _update() + update_player() +end + +function _draw() + cls(12) + draw_bg() + draw_player() + print_ctr("b o r b",8,yellow) +end + +function draw_bg() + for i=0,15 do + spr(64,i*8,120) + end +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(🅾️) and not player.jumping) then + player.vy = -6 + 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 / 2) % 2 + if (player.x < 0) player.x = 0 + if (player.x > 120) player.x = 120 +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__ +ffff00ffffff00ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +fff0880ffff0880f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +ffff800fffff800f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +fff08008000080080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +ff08888ff888888f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +f088888fff88888f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +088888fffff888ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +fff4f4fffff4f4ff0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +44444444000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +44444444000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +14444441000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11144111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +11111111000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +__gff__ +0000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000