Hi,
I'm hoping that someone can help this lingo progamming newbie! I have been
trying to figure out how to use the intersect, rects or points for a small,
first time "game". My problem is that I want to stop a sprite(pChip) from
moving forward when it encounters another sprite(a tree) on the stage--so
that pChip bounces off it the tree -- like it hit a wall. I also want the
tree sprite to repel the pChip sprite should come at the tree from any
angle. (I hope this makes sense!)
Here is my problem:
I can get the pChip sprite to be repelled when it comes from only one
direction(left to right) by using a hidden rectangle and using the "within"
keyword. ( if sprite(pChip).within(sprite (2)) then....
but,
this doesn't really do the trick of repelling pChip from all directions, so
I have been looking into the intersect, the rect, and the point---I can get
the coordinates but I am not understanding how to use them. I've looked in
the Director 7 Bible, Director Demystified and Macromedia's site, but this
poor old brain is just not understanding how to use them.
here is the part of the script that I have written:
if keyPressed(124) = TRUE then
sprite(pChip).member = "chipE"
sprite(pChip).locH = sprite(pChip).locH + 30
if sprite(pChip).within(sprite(2)) = TRUE then
sprite(pChip).member = "chipS"
sprite(pChip).locH = sprite(pChip).locH - 75
sprite(23).member = "gRShake"
upDateStage
wait 15
else if sprite(pChip).within(sprite(2)) = FALSE then
sprite(23).member = "SHAGRASS"
upDateStage
end if
if keyPressed(124) = FALSE then
sprite(23).member = "SHAGRASS"
upDateStage
end if
end if
If someone could please explain how to use the intersect, rect and points, I
would greatly appreciate it! Thanks in advance!
Christine
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi To post messages to the list,
email [EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo. Thanks!]