Charas-Project

Game Creation => Requests => RPG Maker Programming => Topic started by: Desimodontidae on June 28, 2007, 12:34:16 AM

Title: "Hold Down" key
Post by: Desimodontidae on June 28, 2007, 12:34:16 AM
I'm making a Legacy of Goku-type ABS. I want it to be like, you hold down Z for a certain amount of time, and how long you hold it down determines your beam's power when you let go. However, I have no idea how to do that.

Right now, what I have is you hit "Shift" to start charging and you'll stay in a charged state for 2 seconds. In that 2 seconds, you can hit "Shift" as many times as you want (max of 3 so far) to determine how powerful your attack will be when you're done charging (or hit Z or X to cancel out).

Is there any way to do the hold down thingy? And if not does anyone have a better idea? Cause the shift thing's kinda gay.
Title:
Post by: WarxePB on June 28, 2007, 01:32:16 AM
The best thing I can think of is to use a Loop that adds 1 to a variable every .1 seconds as long as the key is held down (see attachment). Then, using branches to check what the second variable is, you could determine the power of the attack.
Title:
Post by: Daetyrnis on June 28, 2007, 01:34:18 AM
Also, don't forget to initialize 'b' as 0.

Even more so, I would recommend labels instead of loops.
Title:
Post by: Ezatoa on June 28, 2007, 02:31:26 PM
I did this once, in a zelda-game, I'd highly recommend labels above loops.
it did work, however it made my game quite laggy ('cause Link was flashing like mad)
Title:
Post by: Desimodontidae on July 01, 2007, 02:52:19 PM
Quote
Originally posted by Warxe_PhoenixBlade
The best thing I can think of is to use a Loop that adds 1 to a variable every .1 seconds as long as the key is held down (see attachment). Then, using branches to check what the second variable is, you could determine the power of the attack.


Not working. For some reason once you hit the button the variable doesn't stop rising. I'll work with it some more, but yeah... if you can help anymore, ya know, that'd be cool..