Web Design Forum: Character Jumping - Web Design Forum

Jump to content

WDF
WDF Premium Memberships Reseller Hosting
Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Character Jumping Rate Topic: -----

#1 User is offline   NickTheGreat 

  • Forum Newcomer
  • Pip
  • Group: Members
  • Posts: 27
  • Joined: 01-January 12
  • Reputation: 4
  • Gender:Male
  • Experience:Intermediate
  • Area of Expertise:Designer/Coder

Posted 01 January 2012 - 08:47 AM

I'm new to flash/actionscript, and I'm attempting to make a pretty simple flash platform game. I got my character easily moving left and right, but I can't figure out jumping.
I tried:
if(Key.isDown(Key.SPACE)){
velocity = 17;
_y = _y + velocity;
}

but that makes him fly... so I tried adding :
if(_y < *input height here*){
velocity = -17;
}


but if the player lets go of the spacebar in midair, the character doesn't fall... can anyone help???
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users