badapple换成ogv视频
This commit is contained in:
Binary file not shown.
@@ -1,55 +1,32 @@
|
|||||||
--Bad Apple!! (128x96, 10fps, 2192f)
|
--Bad Apple!!
|
||||||
local gc=love.graphics
|
local gc=love.graphics
|
||||||
local rectangle=gc.rectangle
|
|
||||||
local int=math.floor
|
|
||||||
local back={}
|
local back={}
|
||||||
|
|
||||||
local bAnd,bRshift=bit.band,bit.rshift
|
|
||||||
local t
|
|
||||||
local video
|
local video
|
||||||
local X,Y,K
|
local X,Y,K
|
||||||
function back.init()
|
function back.init()
|
||||||
if not video then
|
if not video then
|
||||||
video=love.data.decompress("string","zlib",love.filesystem.read("parts/backgrounds/badapple.dat"))
|
video=gc.newVideo("parts/backgrounds/badapple.ogv",{false})
|
||||||
|
video:setFilter("linear","linear")
|
||||||
|
video:play()
|
||||||
end
|
end
|
||||||
t=0
|
|
||||||
back.resize()
|
back.resize()
|
||||||
end
|
end
|
||||||
function back.resize()
|
function back.resize()
|
||||||
local W,H=SCR.w,SCR.h
|
local W,H=SCR.w,SCR.h
|
||||||
if H/W>=96/128 then
|
if H/W>=36/48 then
|
||||||
K=W/128
|
K=W/48
|
||||||
X,Y=0,(H-W*96/128)*.5
|
X,Y=0,(H-W*36/48)*.5
|
||||||
else
|
else
|
||||||
K=H/96
|
K=H/36
|
||||||
X,Y=(W-H*128/96)*.5,0
|
X,Y=(W-H*48/36)*.5,0
|
||||||
end
|
|
||||||
end
|
|
||||||
function back.update()
|
|
||||||
t=t+1
|
|
||||||
if t==13146 then
|
|
||||||
t=0
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function back.draw()
|
function back.draw()
|
||||||
gc.clear(.2,.2,.2)
|
gc.clear(.2,.2,.2)
|
||||||
gc.push("transform")
|
local r,g,b=COLOR.rainbow_light(TIME())
|
||||||
gc.origin()
|
gc.setColor(r,g,b,.2)
|
||||||
gc.translate(X,Y)
|
gc.draw(video,X,Y,nil,K)
|
||||||
gc.scale(K)
|
|
||||||
gc.setColor(.4,.4,.4)
|
|
||||||
local t1=1536*int(t/6)+1
|
|
||||||
for i=0,1535 do
|
|
||||||
local B=video:byte(t1+i)
|
|
||||||
for j=7,0,-1 do
|
|
||||||
local p=8*i+j
|
|
||||||
if bAnd(B,1)==0 then
|
|
||||||
rectangle("fill",p%128,int(p/128),1,1)
|
|
||||||
end
|
|
||||||
B=bRshift(B,1)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
gc.pop()
|
|
||||||
end
|
end
|
||||||
function back.discard()
|
function back.discard()
|
||||||
video=nil
|
video=nil
|
||||||
|
|||||||
BIN
parts/backgrounds/badapple.ogv
Normal file
BIN
parts/backgrounds/badapple.ogv
Normal file
Binary file not shown.
Reference in New Issue
Block a user