A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: So, Nobody Knows How (direction change)?

  1. #1
    Senior Member
    Join Date
    Nov 2000
    Posts
    203
    I'm making a game, and it has a spaceship in (movie clip). What I want the spaceship to do is this: When the game starts, the ships nose is faceing west. But, when I want to move the ship up, I want the ship's nose to face north, now.

    I have the spaceship controlled by the directional keys. I tryed if/else statements, but that didn't work:

    I saw this explained somewhere--how to do it!

  2. #2
    Junior Member
    Join Date
    Nov 2000
    Posts
    24
    All you have to do is change the ship's angle..

    so it would go something like this:

    _root.ship1._angle = (_root.ship1._angle + 90);

    put this inside of your "key.isDown" event.
    The angle is 0 to 360 degrees, and you can even make an if statement so that it keeps adding or subtracting 1 from the angle of the ship each frame until the ship is pointing north -- that way you can make actually rotate upwards instead of it just all of a sudden facing north

    (this is if you're making the game in Flash 5)
    [Edited by ouest_cote on 12-22-2000 at 12:30 AM]

  3. #3
    Senior Member
    Join Date
    Nov 2000
    Posts
    203
    Nevermind, I just used setPropety("", _rotation, #); for this. I'm sure there is better way. Anyone know?

  4. #4
    [Devil in DarkGreen]

    Join Date
    Aug 2000
    Posts
    523
    you can change some instance named movie clip as :
    mc._rotation=XXX;
    that XXX is 0-360

    DS

  5. #5
    Junior Member
    Join Date
    Nov 2000
    Posts
    24
    Ooops, sorry i wrote _angle instead of _rotation.. i don't know what i was thinking.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center