I HAVE A GR8 game where u have a guy that can jump shoot and run but i have nooo clue how the enemys can shoot at my guy
Printable View
I HAVE A GR8 game where u have a guy that can jump shoot and run but i have nooo clue how the enemys can shoot at my guy
how you make him jump i always have problems with a jump function
Use this thingy:
Hope it helpsCode:onClipEvent(enterFrame){
_root.jumping=false;
}
onClipEvent(enterFrame){
//Jumping (with 'a')
if (Key.isDown(65) and _root.jumping == false) {
_root.velY = -10;
_root.jumping = true;
}
if (_root.jumping == true) {
this._y += _root.velY;
_root.velY++;
}
//HitTest (makes hero stop jumping)
if (this.hitTest(_root.ground) && _root.velY>=0) {
_root.velY = 0;
_root.jumping = false;
} else {
_root.jumping = true;
}
}