1 Reply Latest reply on Dec 5, 2010 9:01 PM by kglad

    Actionscript 3 (if, else help)

    deadpoolgun5

      Ok this might be hard to explain but I will try my best here I go.

      I am trying to create a game for Flash CS5 mainly by using actionscript. This game is at a very basic stage and all it consists of is a creature moving (by users input with the arrow keys) around the stage. The screen and creature simulate motion by having animations in their own seperate movie clip frames that simulate movement.

      The future objective of the game will be to dodge objects animating from the top of the screen vertically to the bottom.

      I have established all animations how to move the "creature" and created an Enter Frame event to animate the object to be dodged vertically.

       

      Now here comes the dillema I want the object meant to be dodged to reapear at the top of the screen after it passes the bottom. I have tried an if else statement but it does not seem to work can someone tell me what I should do, what I did wrong or supply some code for me.

       

      if(dodgeobject_mc.y<400){

      dodgeobect.y-=400

      }

       

      I hope you can understand this.