0 Replies Latest reply on Mar 29, 2008 7:43 AM by dmc99

    [F8-AS2] MC code needed to complete game

    dmc99
      Hi,
      I have a game (stage size 600x350) and a bee that flies randomly left to right then right to left across and off the stage. That part works great but every now and then it flies too high to the top of the stage cutting off part of the movie clip. I would like it to not fly higher than y.130 or lower than y.200. This is what I have so far and would appreciate some assistance (movie clip instance is named "bee") to complete this game. Thanks very much.

      if(_root.bee.direction=="left"){
      _root.bee._x=-250;
      _root.bee.speed*=-1;
      _root.bee._xscale*=-1;
      _root.bee.direction="right";
      _root.bee._y=200 + Math.floor(Math.random()*(10-200+1));

      }
      else{
      _root.bee._x=1000;
      _root.bee.speed*=-1;
      _root.bee._xscale*=-1;
      _root.bee.direction="left";
      bee._y = Math.max (130, clipY);
      _root.bee._y=200 + Math.floor(Math.random()*(10-200+1));