Be a Supporter!

Pressing two keys at the ame time.

  • 196 Views
  • 2 Replies
New Topic Respond to this Topic
KuchiyoseRashomon
KuchiyoseRashomon
  • Member since: May. 7, 2007
  • Offline.
Forum Stats
Member
Level 26
Animator
Pressing two keys at the ame time. 2009-03-22 07:38:39 Reply

Hello newgrounds users, anyways my question is, how do I press two keys and make my character move in a diagonal movements (Like up left or up right etc) no worries on the animation part, its just the coding side, I tried using:

if (Key.isDown(Key.UP && Key.LEFT)) {
_y -= 2;
_x -= 2;
gotoAndStop("UPLEFT");
}

But it doesn't respond, no errors pop, so any suggestions?

Denvish
Denvish
  • Member since: Apr. 25, 2003
  • Offline.
Forum Stats
Member
Level 46
Blank Slate
Response to Pressing two keys at the ame time. 2009-03-22 07:39:32 Reply

At 3/22/09 07:38 AM, KuchiyoseRashomon wrote: if (Key.isDown(Key.UP && Key.LEFT)) {

if (Key.isDown(Key.UP) && Key.isDown(Key.LEFT)) {


- - Flash - Music - Images - -

BBS Signature
KuchiyoseRashomon
KuchiyoseRashomon
  • Member since: May. 7, 2007
  • Offline.
Forum Stats
Member
Level 26
Animator
Response to Pressing two keys at the ame time. 2009-03-22 07:53:04 Reply

Yeah fixed, cheers Denvish :D