2 Replies Latest reply on Oct 2, 2008 5:42 PM by {FM}_KingGrishmak

    Some actionscript help required.

    {FM}_KingGrishmak
      Ok guys. Im making a Dawn of War flash game. In this game you pilto a space ship and the game is sort of like Raiden, where the enemies fly down the screen at you.

      Now i need some help with the actionscript coding.
      So far ive drawn up my ship, the ships bullets, and a green circle for actions. The green circle is not visible though. The ship's instance-name is "mc_ship", the bullets instance-name is "mc_bullet", and the actions circle istance-name is "mc_actions".

      So here is the code i have so far.

      On the bullet(mc_bullet) --
      ///////////////////
      onClipEvent (enterFrame) {
      var firing = false
      }

      On the ship(mc_ship) --
      ///////////////////
      onClipEvent (enterFrame) {
      if (Key.isDown(Key.UP)) {
      this._y-=15;
      }
      if (Key.isDown(Key.DOWN)) {
      this._y+=15;
      }
      if (Key.isDown(Key.LEFT)) {
      this._x-=15;
      }
      if (Key.isDown(Key.RIGHT)) {
      this._x+=15;
      }
      if (Key.isDown(Key.SPACE)) {
      firing = true
      }
      }

      On the invisble circle(mc_actions) --
      ///////////////
      onClipEvent (enterFrame) {
      this._visible = false
      if (firing = true) {
      mc_bullet._y = mc_ship._y+40
      }
      }

      ////////////////////////////////

      OK so what happens so far is you can move the ship around with the arrow keys, and that works fine, but now i need to know how to make it shoot. Ive tried so much different code, but none of it seems to work. Ive gone close experimenting with my own knowledge of the code, but now ive turned to you guys.

      The movement works fine, its just the shooting I need help with. I also need to know how i can make it work without completely changing my code. But I will do it all over again, only if neccessary.

      Thanks for any help.

      (BTW, I didnt use attach code, because I just signed up to these forums and I copied the code straight from one of MY other posts on another forum.)