Be a Supporter!

textbox/arrow keys prob.

  • 204 Views
  • 5 Replies
New Topic Respond to this Topic
denmen7
denmen7
  • Member since: Jan. 3, 2010
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
textbox/arrow keys prob. 2010-12-01 11:56:11 Reply

im havin this problem cuz i want to everytime you press up or down than cutCount += 1;
the only thing is that when I press up or down cut count keeps increasing by 1 until i release the key (obvious since i used if(Key.isDown)
if you know a way that might work plese say so
thanks

denmen7
denmen7
  • Member since: Jan. 3, 2010
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to textbox/arrow keys prob. 2010-12-01 12:15:16 Reply

AS2 by the way

Niallmcfc
Niallmcfc
  • Member since: Aug. 16, 2009
  • Offline.
Forum Stats
Member
Level 09
Gamer
Response to textbox/arrow keys prob. 2010-12-01 13:13:08 Reply

You could set a timer, and if it's held down for more than 1 button press' time, it stops adding?

It's a bit roundabout...


Signature? What signature?

Also, any games I plan to make may or may not become vaporware. I'm not good with organizing my life...

denmen7
denmen7
  • Member since: Jan. 3, 2010
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to textbox/arrow keys prob. 2010-12-01 13:28:18 Reply

sorry what? can you explain please
thanks

CyberXR
CyberXR
  • Member since: Aug. 22, 2008
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to textbox/arrow keys prob. 2010-12-01 14:09:28 Reply

At 12/1/10 01:28 PM, denmen7 wrote: sorry what? can you explain please
thanks

What you have to do is to write a function which checks if the key has been Released. You can use a bool to become true if the key has been released and if it has and you press the key again the cutCount will ++. I am not gicing you the code right away, just giving you the tools to solve the problem.


Check out the coolest Donkey Kong Game on NG!
http://www.newgrounds.com/portal/vi ew/459064
100 posts @ Posted at: 9/15/08 07:36 AM http://www.newgrounds.com/bbs/topic /969232

denmen7
denmen7
  • Member since: Jan. 3, 2010
  • Offline.
Forum Stats
Member
Level 09
Blank Slate
Response to textbox/arrow keys prob. 2010-12-01 15:24:23 Reply

oooh, ye ye i get it, thanks