Thanks Jonas, how would I record the previous loc??? and then set that, I
have it stoping and then bouncing off but it would probally be better to
make it bounce back to the previous loc and therefore it won't bounce back
across the track to the amount I have set to go in reverse, I have only set
it this amount so as to give the effect , do you think the previous loc
would be better.?? Here's the script I'm using..
global maxspeed, speed, gopedx, gopedy
on exitFrame
if sprite 1 intersects sprite 3 then
speed=0-10
play the frame
end if
end
on enterframe me
if keypressed (126) then
-- increase speed
speed = Accelerate(speed,maxspeed)
if sprite(1).membernum=member("goped6").membernum THEN
sprite(1).membernum=member("goped").membernum
else
sprite(1).membernum=sprite(1).membernum+1
end if
updatestage
end if
if keypressed (125) then
-- decrease speed
speed = speed *.7
speed = Deccelerate(speed,maxspeed)
end if
if keypressed (124) then
-- rotate goped
sprite(1).rotation = sprite(1).rotation + 7
end if
if keypressed (123) then
sprite(1).rotation = sprite(1).rotation - 7
end if
end if
end me
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of Jonas Brink Wors�e
Sent: 25 November 2000 03:47
To: [EMAIL PROTECTED]
Subject: Re: <lingo-l> To move or not to move. ( that is the
question!!!!!!! )
You're not giving much information on how you're moving the stuff, but
perhaps these comments will help you.
When moving something (i.e. a sprite) by keypresses, it is always a good
idea to set a variable according to the keypressing and then move the sprite
according to that variable. That way you can easily, when certain conditions
have been met, like collision or bounderycrossing of some sort, change that
variable. Like "myMovement=0" or "myMovement=-myMovement". The last example
will make the sprite move in the opposite direction. Sort of like bouncing,
I guess. Well, not quite, but perhaps enough to suit your needs.
Furthermore, upon methods of collisiondetection, it is always a good idea to
store the previous postion just before moving the object, so that you can
restore the object back to where it was before the collision.
I hope this helps. If not, you might want to post your code in order to get
a more accurate answer.
Fare well into the world of Lingo.
/jonas
----- Original Message -----
From: Rees, Jonathan <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, November 25, 2000 2:45 AM
Subject: <lingo-l> To move or not to move. ( that is the question!!!!!!! )
> The sprite is moving across the stage, it interacts with another object.
How
> do I prevent it from going over the the other object or making it bounce
> back say 2 pixels in the reverse direction.
[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!]
[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!]