-
Notifications
You must be signed in to change notification settings - Fork 0
/
coroutine.p8
50 lines (44 loc) · 1.34 KB
/
coroutine.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
pico-8 cartridge // http://www.pico-8.com
version 18
__lua__
function _init()
c_move=cocreate(move)
end
function _update()
if c_move and costatus(c_move)!="dead" then
coresume(c_move)
else
c_move=nil
end
if (btnp()>0) c_move=cocreate(move)
end
function _draw()
cls(1)
circ(x,y,r,12)
print(current,4,4,7)
end
function move()
x,y,r=32,32,8
current="left to right"
for i=32,96 do
x=i
yield()
end
current="top to bottom"
for j=32,96 do --top to bottom
y=j
yield()
end
current="back to start"
for i=96,32,-1 do --back to start
x,y=i,i
yield()
end
end
__gfx__
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000