Decreasing Var's on hittest

  • Jummm
  • Novice
  • Novice
  • Jummm
  • Posts: 17

Post 3+ Months Ago

Im making a defense game, i have the defense (castle thing) on the right, i have my "enemy" going right, part of the enemys code is the folowing:

onClipEvent (load) {
_root.speed = 3;
{ _root.speed -= 2
} }
onClipEvent (enterFrame) {


So i got my dude going right at 3 pixals every frame, "defense" is the instance of a movie clip on the main stage, its ment to be a trench to slow down enemys, but the enemys speed doesnt change once it touch's "defense"

Is the actionscript have a mistake init? wrong way round? It doesnt report any mistake when i test the game...

Help please
  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1252
  • Loc: Ro

Post 3+ Months Ago

Code: [ Select ]
onClipEvent (enterFrame) {


  1. onClipEvent (enterFrame) {
  2. this._x-=-_root.speed;
  3. }

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 6 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum

© 1998-2017. Ozzu® is a registered trademark of Unmelted, LLC.