Event.Load
extern.close("{APP_NAME}") // Only one instance allowed
app.init("{APP_ID}", "{APP_NAME}", "{APP_VERSION}", "{APP_BUILD}", "{CREATE_LOG}")
app.booster(true)
&iMem = draw.mem.create()
draw.&iMem.load(path.rsc("Back.bmp"))
draw.&iMem.load(path.rsc("Face.bmp"), 145, 0)
&Sound = "Conga.wav"
for(&ptr, 0, 4)
&Ch[&ptr] = sound.channel.create(path.rsc(&Sound))
sound.&Ch[&ptr].volume(900 + &ptr*20)
for.next
for(&ptr, 0, 4)
&Echo[&ptr] = 100
for.next
&Size = 50
&x = 50
&y = 50
window.main.pos.now(250,250,0,0)
window.main.shape.load(path.rsc("Face.bmp"), true, true)
window.main.visible(true)
doEvent.waitTimer()
event.end
event.mouse:down
&mx = mouse.main.x()
&my = mouse.main.y()
&Note = 0
If(num.isInRect(&mx, &my, 14, 51,40, 40) = true)
&Note = 75
If.End
If(num.isInRect(&mx, &my, 51, 17,31, 31) = true)
&Note = 150
If.End
If(num.isInRect(&mx, &my, 97, 24,25, 25) = true)
&Note = 250
If.End
If(num.isInRect(&mx, &my, 116, 60,22, 20) = true)
&Note = 340
if.end
if(num.isInRect(&mx, &my, 111, 92,17, 16) = true)
&Note = 425
if.end
if(&Note > 0)
var.inc(cCh,1,4,0)
var.inc(Tremolo, 148)
&x[&cCh] = &mx
&y[&cCh] = &my
&Echo[&cCh] = 0
sound.&Ch[&cCh].rate(&Note + num.cos(&Tremolo, 5))
sound.&Ch[&cCh].position(0)
sound.&Ch[&cCh].play()
if.end
event.end
event.waitTimer
draw.main.copyFrom.&iMem(145,0, 145, 125, 0, 0, 145,125, 50, true, 255)
&ptra = time.chrono.stop()/150
for(&i, 200, 360, 75)
&a = num.cos(&i+&ptra/2, 100)+100
draw.main.ellipse(num.cos(&i*2 + &ptra*2, &i/(&Size/20)) + &Size/8,num.sin(&i + &ptra*2, &i/(&Size/20))+ &Size/8,&Size, &Size, num.rgb(&a, &a, 0),&i/5, 20)
for.Next
draw.main.copyFrom.&iMem(0,0, 145, 125, 0, 0, 145,125,100, true, draw.&iMem.getPixel(28, 22))
for(ep, 0, 4)
If(&Echo[&ep]<100)
&Echo[&ep] = &Echo[&ep] + 10
draw.main.ellipse(&x[&ep]-&Echo[&ep]/2, &y[&ep]-&Echo[&ep]/2,&Echo[&ep], &Echo[&ep],num.rgb(150,0,0), 10, 40-(&Echo[&ep]/3))
if.end
for.next
draw.main.paint()
doEvent.waitTimer(10)
event.end
|