Forums

ForumsProgramming Forum

Help with Rotation

Posted Mar 4, '08 at 7:53am

chiliad_nodi

chiliad_nodi

648 posts

onClipEvent (load) {
    this._y = 1;
    this._x = 1;
    this.speed = 4;
}
onClipEvent (enterFrame) {
    if (this._y>_root.mouse._y+5) {
        this._y -= this.speed;
        }
    if (this._y_root.mouse._x-5) {
        this._x -= this.speed;
        this.gotoAndPlay(1);
    }
    if (this._x

 

Posted Mar 4, '08 at 5:57pm

chiliad_nodi

chiliad_nodi

648 posts

Amazing! I don't understand half the code, but it looks like it works. That bunch of code up there is the first actual coding I wrote for a movie clip in a game. I can see that I still a long way to go before I understand actionscript.
I have one other think that can be solved by soneone who knows actionscript.
if (this._x_root.mouse._x+1) {
        this.gotoAndPlay(1);
This makes the animation only play 2 frames.
I need to make it play on the firt frame and on the 52 frame. all the coding inside the mc is set.

 

Posted Mar 4, '08 at 11:43pm

chiliad_nodi

chiliad_nodi

648 posts

No, actually this is for changing the mc's frames depending on where the movieclip is in perspective of another mc. 1-52 are an animation and 53-104 are another animation.
Thanks.

 

Posted Mar 5, '08 at 3:00pm

chiliad_nodi

chiliad_nodi

648 posts

Hang on. I just tried the first code you gave me, and the mc goes in the opposite direction of the mouse. It also faces away from the mouse. Since I don't really understand the code, can you please fix it? I think there was a misunderstanding. I want the eagle to follow a mc (instance)named "mouse"
Oh yeah. I am trying to have it change the set of frames it plays depending on whether it is to the left or to the right of the mc named "mouse."

 

Posted Mar 6, '08 at 6:54pm

chiliad_nodi

chiliad_nodi

648 posts

What does Math.Pl mean?
Thank you for listening and correcting.
Sorry if I am asking too many questions.

 
Reply to Help with Rotation

You must be logged in to post a reply!