home *** CD-ROM | disk | FTP | other *** search
- on moveBar
- set sp to 39
- set w to the width of sprite sp
- set the locH of sprite sp to min(max(the mouseH - (w / 2), 0), 640 - the width of sprite sp)
- updateStage()
- end
-
- on bounceBall
- global gList, gList1
- set sp to 40
- set x to getAt(gList, 1)
- set Y to getAt(gList, 2)
- set w to the width of sprite sp
- set a to the bottom of sprite sp
- set b to the left of sprite sp
- set c to the right of sprite sp
- set D to (a + Y) >= 480
- set e to (a + Y) >= the top of sprite (sp - 1)
- set f to (b + x + w) >= the left of sprite (sp - 1)
- set g to (b + x) <= the right of sprite (sp - 1)
- if (c + x) >= 640 then
- sound playFile 2, "MouseDWN.AIF"
- setAt(gList, 1, -x)
- else
- if (b + x) <= 0 then
- sound playFile 2, "MouseDWN.AIF"
- setAt(gList, 1, -x)
- else
- if (the top of sprite sp + Y) <= 0 then
- sound playFile 2, "MouseDWN.AIF"
- setAt(gList, 2, -Y)
- else
- if D then
- sound playFile 2, "MouseDWN.AIF"
- setAt(gList, 2, -Y)
- else
- if e and f and g then
- sound playFile 2, "delt.AIF"
- setAt(gList, 2, -Y)
- set q to the left of sprite (sp - 1)
- set r to the width of sprite (sp - 1)
- set myWidth to r + (2.0 * w)
- set POS to (b + (w / 2) - (q - w)) / myWidth
- if x > 0 then
- set sign to 1
- else
- set sign to -1
- end if
- setAt(gList, 1, POS * sign * 2 * Y)
- else
- repeat with i in gList1
- if sprite sp intersects i then
- sound playFile 2, "MouseUp.AIF"
- set the visible of sprite i to 0
- set x to getPos(gList1, i)
- if (the top of sprite sp <= the bottom of sprite i) or (the bottom of sprite sp >= the top of sprite i) then
- setAt(gList, 2, -Y)
- end if
- deleteAt(gList1, x)
- set num to count(gList1)
- if num then
- setAt(gList, 2, getAt(gList, 2) + 0.29999999999999999)
- end if
- exit repeat
- end if
- end repeat
- end if
- end if
- end if
- end if
- end if
- set x to getAt(gList, 1)
- set Y to getAt(gList, 2)
- set a to getAt(gList, 3)
- set b to getAt(gList, 4)
- set the locH of sprite sp to integer(a + x)
- set the locV of sprite sp to integer(b + Y)
- setAt(gList, 3, a + x)
- setAt(gList, 4, b + Y)
- end
-