-
Notifications
You must be signed in to change notification settings - Fork 2
/
sprite_vscroll.p8
56 lines (52 loc) · 2.62 KB
/
sprite_vscroll.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 36
__lua__
-- get address of a sprite
getsp=function(sp)
n=512*(sp\16)+4*(sp%16)
return n
end
--shift lines of a sprite
spshift=function(n,t)
--n: sprite numner
--t: timing
if _t%t==0 then
local new=getsp(n)
local top=peek4(new+7*64)
local vals={}
for v=0,6 do
local shift=new+v*64
add(vals,peek4(shift))
end
for v=1,#vals do
poke4(new+v*64,vals[v])
end
poke4(new,top)
end
end
function _init()
_t=0 -- time count
end
function _update()
_t+=1
spshift(1,1)
spshift(2,8)
end
function _draw()
cls()
map(0,0,48,48,4,4)
end
__gfx__
0000000080808080eeeeeeee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000080808080eeeeee000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
007007000000000000eeee0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0007700080808080000ee00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00077000080808080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00700700000000000999999000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000888888880099990000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000009900000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__map__
0101020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0101020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0101020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0101020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000