// 10 windows are animated (One window per bee).
event.load
extern.close("{APP_NAME}") // Only one instance allowed
app.init("{APP_ID}", "{APP_NAME}", "{APP_VERSION}", "{APP_BUILD}", "{CREATE_LOG}")
system.priority(low) // So applications in the background can refresh faster
&beei = draw.mem.createFromFile("beebeeb.bmp")
&curb = 0
for(&ptr, 0, 10)
&bee[&ptr] = window.create(true, null, false, false, false, false)
window.&bee[&ptr].shape.from.&beei()
window.&bee[&ptr].pos.now(num.random(0, screen.width()), num.random(0, screen.height()))
window.&bee[&ptr].stayOnTop(true)
draw.&bee[&ptr].copyFrom.&beei()
draw.&bee[&ptr].paint()
for.next
time.chrono.start()
doEvent.Anim()
event.end
event.Anim()
// Close when the esc, space or left mouse button is pressed
if(keyboard.keyState(27) = true || keyboard.keyState(32) = true || keyboard.keyState(1) = true)
app.close()
if.end
&p = time.chrono.stop()/10
for(&ptr, 0, 10)
&cx = window.&bee[&ptr].left()
&cy = window.&bee[&ptr].top()
if(&cx > mouse.x())
&cx = &cx - 3
if.else
&cx = &cx + 3
if.end
if(&cy > mouse.y())
&cy = &cy - 3
if.else
&cy = &cy + 3
if.end
&deltax = (mouse.x() - &cx)/40+10
&deltay = (mouse.y() - &cy)/40+10
window.&bee[&ptr].pos.now(num.sin(&p+&ptr + &ptr*30, &deltax) + &cx,num.cos(&p/2 + &ptr*36, &deltay) + &cy)
for.next
doEvent.anim()
event.end
|