A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: I GOT A GR8 GAME

  1. #1
    Member
    Join Date
    Aug 2002
    Posts
    53
    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

  2. #2
    Time Killer sspskater's Avatar
    Join Date
    Jun 2002
    Location
    Closer to u then u think
    Posts
    493
    how you make him jump i always have problems with a jump function

  3. #3
    SaphuA mosterdfles_flash's Avatar
    Join Date
    Jan 2002
    Location
    Tha Couch
    Posts
    935

    hmmm...

    Use this thingy:

    Code:
    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;
         }
    }
    Hope it helps

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center