Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: Reverse direction |
From: | Robert Bleeker |
Date: | Fri, 21 Apr 2000 06:59:21 +0100 |
Hi Thorvald,
I presume that you are running that script in a 2 (or more) frame loop
re-executing it every loop!
It looks like the MC stops because you are decreasing the x position at the
top of the script and then increasing it at the bottom when it makes the
collision, this way it will stay in the collision position.
Try the following:
Set Property ("", X Position) = GetProperty ( "", _x ) - xSpeed
Set Variable: "sbootX" = GetProperty("/sboot",_x)
Set Variable: "sbootY" = GetProperty("/sboot",_y)
Set Variable: "walX" = GetProperty("",_x)
Set Variable: "walY" = GetProperty("",_y)
If ((walX > (sbootX - 33)) and (walX < sbootX) and (walY > (sbootY - 13))
and
(walY < (sbootY + 13)) and (GetProperty ( "/sboot", _currentframe ) = 1))
Set variable: "xSpeed"=xSpeed*-1
End If
What you want to do is turn the "xSpeed" into a neagtive value as "--xSpeed"
mean "+xSpeed". You might have to use another variable if you are using this
"xSpeed" for more than 1 MC.
Robert
on 21/4/00 2:06 AM, Thorvald Neumann at hrafnmuenster [dot] de wrote:
> Hejsan!
>
> At the moment I am building a small Flash game and I have a small
> problem:
>
> When a specific MC hits another MC, it shall reverse the
> direction. In spite of reversing its direction, it just stops.
>
> This is the script I used:
>
> Set Property ("", X Position) = GetProperty ( "", _x ) - xSpeed
> Set Variable: "sbootX" = GetProperty("/sboot",_x)
> Set Variable: "sbootY" = GetProperty("/sboot",_y)
> Set Variable: "walX" = GetProperty("",_x)
> Set Variable: "walY" = GetProperty("",_y)
> If ((walX > (sbootX - 33)) and (walX < sbootX) and (walY > (sbootY - 13)) and
> (walY < (sbootY + 13)) and (GetProperty ( "/sboot", _currentframe ) = 1))
> Set Property ("", X Position) = GetProperty ( "", _x ) + xSpeed
> End If
>
> What am I doing the wrong way? I have also tried to include a Tell
> Target command in the if-clause, but this does not change stopping the
> MCs course.
>
> Best regards,
>
> Thorvald Neumann
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the last 100 messages from the flasher list NOW
http://www.chinwag.com/flasher/last100.shtml
Flash books http://www.chinwag.com/flasher/books.shtml
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
Re: FLASH: Reverse direction, Thorvald Neumann
Replies
FLASH: Reverse direction, Thorvald Neumann
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]