home *** CD-ROM | disk | FTP | other *** search
- on moveball p
- global moveend, d, x, y, lh, lv
- set lhkeep to the locH of sprite (p + 7)
- set lvkeep to the locV of sprite (p + 7)
- if lhkeep <= 136 then
- if lvkeep <= 131 then
- holein(p, 1)
- else
- if lvkeep >= 349 then
- holein(p, 2)
- end if
- end if
- else
- if lhkeep >= 504 then
- if lvkeep <= 131 then
- holein(p, 3)
- else
- if lvkeep >= 349 then
- holein(p, 4)
- end if
- end if
- end if
- end if
- set md to getAt(d, p)
- if md > 0 then
- set mx to getAt(x, p)
- set my to getAt(y, p)
- set mlh to getAt(lh, p) + (md * mx)
- set mlv to getAt(lv, p) + (md * my)
- if ((mlh < 120) or (mlh > 520)) and (abs(mx * md) > 1) then
- puppetSound("clash")
- set mx to mx * -1
- set mlh to constrainH(1, mlh)
- end if
- if ((mlv < 115) or (mlv > 365)) and (abs(my * md) > 1) then
- puppetSound("clash")
- set my to my * -1
- set mlv to constrainV(1, mlv)
- end if
- set md to md - 0.07999999999999999
- if md < 0.09999999999999999 then
- set md to 0
- end if
- set the locH of sprite (p + 7) to mlh
- set the locV of sprite (p + 7) to mlv
- setAt(d, p, md)
- setAt(x, p, mx)
- setAt(y, p, my)
- setAt(lh, p, mlh)
- setAt(lv, p, mlv)
- end if
- if md > 0 then
- set moveend to 1
- else
- setAt(x, p, 0)
- setAt(y, p, 0)
- end if
- end
-