Skip navigation
Shockeey
Currently Being Moderated

How can I make a wall in a game AS2

Sep 12, 2012 4:32 AM

Tags: #flash #frame #button #buttons #as2 #actionscript #movieclip #actionscript_2 #game #movie #clip #2.0 #movie_clip

Earlier I've declarded my speed_var as 5 and allocated it a button so it moves at 5 pixles so in theory it should stop, have I written it wrong?

 

 

player1_mc.onEnterFrame = function(){

 

if (this.hitTest(wall1_mc)){

  trace(this.hitTest(wall1_mc));

  speed_var -5;

}


}

 
Replies
  • Currently Being Moderated
    Sep 12, 2012 4:59 AM   in reply to Shockeey

    Do you mean to write:   speed_var = speed_var - 5;  (or speed_var -= 5; ) ?

     
    |
    Mark as:
  • Currently Being Moderated
    Sep 12, 2012 5:20 AM   in reply to Shockeey

    That is what that line I showed will do, it will decrease the speed_var value by 5, not make it equal -5.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points