Recently, Simon Lord wrote:

> Here's an ultra simple script:
> 
> on mouseDown
> move grc "ball" to the points of grc "theLine" in 30 ticks without waiting
> 
> if intersect(grc "ball", grc "gAspectPos") then
> beep
> exit to metacard
> end if
> end mouseDown
> 
> 
> For whatever reason, even when the two graphics are *obviously* overlapping,
> the intersection is never detected.
> 
> Any ideas?

Yes -- you're only checking the intersect once in your script.  You need to
repeatedly check for any intersections.  Try the following (tested and works
on my end):

on mouseUp
 move grc "ball" to the points of grc "theLine" in 30 ticks without waiting
 checkIntersect
end mouseUp

on checkIntersect
  if intersect(grc "ball", grc "gAspectPos") then
    beep
    stop moving grc ball
    exit to metacard
  end if
  send checkIntersect to me in 50 milliseconds
end checkIntersect

-----

FWIW, I've been experimenting with a simple but also fairly capable sprite
handling system, which allows sprite objects to follow predefined behaviors,
all based on repeating "send in" messages.  To date I've tested nine
asynchronously moving bitmap sprites along with the mouse-controlled sprite,
and the results are phenomenal (MacOS).  On-screen movement is smooth and
virtually jitter-free.  Scott Raney & company have really done some great
stuff with the move command.

In any event, I'll either post the "game" as open source or try to make a
somewhat customizable version for folks who want to experiment.

Regards,

Scott

__________________________________________________________________
Scott Rossi                    Tactile Media - Multimedia & Design
Creative Director              Email: [EMAIL PROTECTED]
                               Web: www.tactilemedia.com

  • Moving Simon Lord
    • Scott Rossi

Reply via email to