-
Notifications
You must be signed in to change notification settings - Fork 1
/
invaders.p8
56 lines (44 loc) · 2.26 KB
/
invaders.p8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
-- space invaders
-- by simone
px = 60
py = 120
rx = 0---1
ry = 0---1
function _update()
-- tick game state
if (ry > 0) ry = ry-2
-- handle input
if (btn(⬅️) and px > -1) px = px-1
if (btn(➡️) and px < 121) px = px+1
if btnp(❎) and ry <= 0 then
if (ry > 0) return
rx = px+4
ry = py-1
end
end
function _draw()
cls()
rectfill(0,0,127,127,1)
spr(1,px,py)
if rx > 0 and ry > 0 then
pset(rx,ry,7)
end
end
__gfx__
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000020000200020020002000020002222000022220000222200002002000002200000022000000220000002200000022000200220020202202020022002
00700700002002000020020000200200020220200202202002022020200220020202202000222200002222000022220000222200020220200202202002022020
00077000000220000002200000022000022222200222222002222220022222200222222002222220020220200202202002022020002222000022220000222200
00077000002222000022220000222200002002000020020000200200020220200202202002022020222222220222222002222220020220200202202002022020
00700700020220200202202002022020000220000020020002000020022222200222222002222220020000202200002202200220022002200220022002200220
00000000002002000200002020000002000000000000000000000000002002000020020000200200000000000000000000000000200000022000000202000020
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000022222200222222002222220000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000020220200202202002022020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000002002000020020000200200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000020000200200002002000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000200000020200002000200200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000