Charas-Project

  • Home
  • Help
  • Search
  • Calendar
  • Login
  • Register
*
Please login or register.

Login with username, password and session length
 

News:

Click here to join us on IRC (#charas on irc.freenode.net)!



  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • "Hold Down" key
« previous next »
  • Print
Pages: [1]

Author Topic: "Hold Down" key  (Read 2393 times)

Offline Desimodontidae

  • Registered July 13, 2004, 10:41:19 AM (+1692 post counts)
  • Agent
  • *
  • Posts: 892
  • ghost host
    • perpetual massacre
"Hold Down" key
« 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.
Logged
My MGS3 main character sprites

Offline WarxePB

  • Action Sue
  • Royal
  • *
  • Posts: 3,601
  • What killed the dinosaurs?
    • The Gigaverse
(No subject)
« Reply #1 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.
Logged
Blog: The Gigaverse
Twitter: Initial Chaos

Offline Daetyrnis

  • Zealot
  • *
  • Posts: 616
    • Organization 13½
(No subject)
« Reply #2 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.
Logged

Offline Ezatoa

  • Member
  • Initiate
  • *
  • Posts: 3
  • working on a DarkFighter game, with a full party ABS!
(No subject)
« Reply #3 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)
Logged
DarkFighter: (No Title Yet)
ABS:  0%
Maps: 2%
Field Systems: 83%

Offline Desimodontidae

  • Registered July 13, 2004, 10:41:19 AM (+1692 post counts)
  • Agent
  • *
  • Posts: 892
  • ghost host
    • perpetual massacre
(No subject)
« Reply #4 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..
Logged
My MGS3 main character sprites

  • Print
Pages: [1]
« previous next »
  • Charas-Project »
  • Game Creation »
  • Requests »
  • RPG Maker Programming »
  • "Hold Down" key
 

  • SMF 2.0.10 | SMF © 2015, Simple Machines
  • XHTML
  • 2O11
  • RSS
  • WAP2
  • Simple Machines Forum