song
This commit is contained in:
98
lou.p8
98
lou.p8
@@ -4,16 +4,17 @@ __lua__
|
||||
--main
|
||||
|
||||
function _init()
|
||||
printh("lou is initializing")
|
||||
cartdata("lou")
|
||||
lou:init()
|
||||
printh("lou has arrived :)")
|
||||
end
|
||||
|
||||
function _update()
|
||||
lou.age+=sincelast()
|
||||
savedate()
|
||||
printh("lou's current age: "..lou.age)
|
||||
state[cs]:update()
|
||||
bgm:loop()
|
||||
fc+=1
|
||||
|
||||
end
|
||||
|
||||
function _draw()
|
||||
@@ -22,6 +23,10 @@ end
|
||||
-->8
|
||||
--globals
|
||||
|
||||
|
||||
gameover=false
|
||||
cs=1 --current state
|
||||
fc=0 --frame counter
|
||||
-->8
|
||||
--functions
|
||||
|
||||
@@ -36,18 +41,35 @@ function savedate()
|
||||
end
|
||||
|
||||
function sincelast()
|
||||
y=stat(90)-dget(0)*311.040 --yeras
|
||||
mo=stat(91)-dget(1)*25.920 --30 days in a month
|
||||
d=stat(92)-dget(2)*864
|
||||
h=stat(93)-dget(3)*36
|
||||
m=stat(94)-dget(4)*.6
|
||||
s=stat(95)-dget(5)*.01
|
||||
y=(stat(90)-dget(0))
|
||||
if y>0 then
|
||||
gameover=true
|
||||
end
|
||||
y=0
|
||||
mo=(stat(91)-dget(1))*25.920 --30 days in a month
|
||||
d=(stat(92)-dget(2))*864
|
||||
h=(stat(93)-dget(3))*36
|
||||
m=(stat(94)-dget(4))*.6
|
||||
s=(stat(95)-dget(5))*.01
|
||||
return s+m+h+d+mo+y
|
||||
end
|
||||
|
||||
|
||||
-->8
|
||||
--state
|
||||
state={
|
||||
{ --1 gameplay
|
||||
m={0,1},--music
|
||||
ml=128,--music length
|
||||
cm=0,
|
||||
update=function(self)
|
||||
|
||||
end,
|
||||
draw=function(self)
|
||||
end,
|
||||
},
|
||||
{}
|
||||
}
|
||||
-->8
|
||||
--lou
|
||||
lou={
|
||||
@@ -72,6 +94,43 @@ lou={
|
||||
dset(1,self.age)
|
||||
end
|
||||
}
|
||||
-->8
|
||||
--bgm
|
||||
bgm={
|
||||
tracklist={
|
||||
{
|
||||
n=2,
|
||||
l=254
|
||||
},
|
||||
{
|
||||
n=0,
|
||||
l=127
|
||||
},
|
||||
{
|
||||
n=1,
|
||||
l=127
|
||||
}
|
||||
},
|
||||
l=254,
|
||||
c=1,
|
||||
t=-1,
|
||||
loop=function(self)
|
||||
if (self.t>self.tracklist[self.c].l) self.t=0
|
||||
if self.t==0 then
|
||||
self.c+=1
|
||||
|
||||
printh("playing: "..self.c)
|
||||
if self.c>count(self.tracklist) then
|
||||
self.c=1
|
||||
printh("ok")
|
||||
end
|
||||
music(self.tracklist[self.c].n)
|
||||
|
||||
|
||||
end
|
||||
self.t+=1
|
||||
end
|
||||
}
|
||||
__gfx__
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
@@ -79,3 +138,24 @@ __gfx__
|
||||
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00077000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
00700700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
__sfx__
|
||||
000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
011000000e0200e0200e0200e0200e0200e0200e0200e0200e0200e0200e0200e0200e0200e0200e0200e0200b0200b0200b0200b0200b0200b0200b0200b0200b0200b0200b0200b0200b0200b0200b0200b020
|
||||
011000001e150000001e000000001e150000001e000000001e150000001e000000001e150000001e000000001e150000001e000000001e150000001e000000001e150000001e000000001e150000001e00000000
|
||||
01100000000000000000000000001a1500000000000000001a1500000000000000001a1500000000000000001a0000000000000000001a1500000000000000001a1500000000000000001a150000000000000000
|
||||
001000000000015000151501500000000150001515000000000001500015150150000000015000151500000000000000001315000000000000000013150000000000000000131500000000000000001315000000
|
||||
011000000c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c020
|
||||
011000001c1500000000000000001c1500000000000000001c1500000000000000001c1500000000000000001c1500000000000000001c1500000000000000001c1500000000000000001c150000000000000000
|
||||
01100000000000000013150000001a0000000013150000001a0000000013150000001a0000000013150000001a0000000013150000001a0000000013150000001a0000000013150000001a000000001315000000
|
||||
01100000000001300013000000001a1501300013000000001a1500000013000000001a1500000013000000001a0000000013000000001a1500000013000000001a1500000013000000001a150000001300000000
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
002000000e0200e0200e0200e0200e0200e0200e0200e0200b0200b0200b0200b0200b0200b0200b0200b0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c0200c020
|
||||
001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0020000000000151501a150151501a150151501a1501515000000131501a150131501a150131501a1501315000000131501a150131501a150131501a150131501a150131501a150131501a150131501a15013150
|
||||
002000001e150000001e150000001e150000001e150000001e150000001e150000001e150000001e150000001c150000001c150000001c150000001c150000001c150000001c150000001c150000001c15000000
|
||||
__music__
|
||||
00 01020304
|
||||
00 05060708
|
||||
00 0a440c0d
|
||||
00 0a0c0d13
|
||||
|
||||
|
Reference in New Issue
Block a user