Lua Colors Spinning Fan

Banget - Custom level - from Android
PlayEdit4 players liked this.Log in to like this level.

If fan led Colored Spinning.
Lua:
function init(is_sandbox)
id=world:get_entity(47)
tab={}
--Colors--
r={r=1,g=0,b=0.0,a=1}
g={r=0,g=1,b=0.0,a=1}
b={r=0,g=0,b=1.0,a=1}
w={r=1,g=1,b=1.0,a=1}
B={r=0,g=0,b=0.0,a=1}
p={r=1,g=0,b=0.5,a=1}
y={r=1,g=1,b=0.0,a=1}
a={r=1,g=1,b=1.0,a=0}
----------
--Draw--
draw={
a,r,a,g,a,b,a,w,a,p,a,y
}
--------
--Texels--
width=12
height=1
for y=0,height-1,1 do
for x=0,width-1 do
color=draw[1+y*width+x]
this:set_sprite_texel(x,height-y-1,color.r,color.g,color.b,color.a)
end
end
----------
speed=2
maxspeed=0
rot=0
end
function step(count)
if this:read(0)==1 then
this:set_sprite_blending(1)
this:set_sprite_filtering(0)


maxspeed=maxspeed+.003
if maxspeed>speed then maxspeed=speed end
rot=rot-maxspeed
else
maxspeed=0
end
lifespan=10
table.insert(tab,1,{rot})
tab[lifespan]=nil

x,y=id:get_position()
this:set_draw_z(id:get_layer()-1)
for i=1,#tab do
if this:read(0)==1 then
this:draw_sprite(x,y,tab[i][1],5,0.2,0,0,width,height)
end
end
end

Views: 308 Downloads: 91 Unique objects: 1 Total objects: 52

Discuss this level

Log in to comment on this level.
  • JOELwindows7: @Banget: ;)
  • Banget: @JOELwindows7: Wah suka sekali dari JOELwindows7.
    Saya membeli di pasar seharga:
    Led fan: Rp 40000,00
    Led usb fan: Rp 25000,00
    Cuman murah aja.

    Saya suka ini!
    Pilih:
    Led fan
    Led usb fan
  • JOELwindows7: Extremly Duper Awesome!!
    Wow bagus sekali!!! Saya suka dengan yang ini!!!!!
    Beli di pasar, murah, cuman Rp 25000,00

LEVEL ID: 25394