Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

[Resolved] Holding a direction button?

Status
Not open for further replies.
Hi there. I am doing an event system that needs a tiny bit of script, and I was wondering how you do it. In the common event, I have a condition branch, and I want to know, how do you script, if directionbutton held? Sorry if this isn't very clear, I don't really know how to word it. But basically I want it to be able to tell if a directional button is being held. Thanks guys, this will be a big help. Later, Roxas.
 

Anonymous

Guest

Input.press?(num)

Will tell you if the button is being currently pressed (Help file, people, help file!).

To check the down button, use:

Input.press?(Input::DOWN)
 
You can also use the Input.dir4 or Input.dir8

Code:
Input.dir4   -> 0 : No Direction, 2 : Down, 4 : Left, 6 : Right, 8 : Up
Input.dir8   -> As Above, : 1 : Down Left, 3 : Down Right, 7 : Up Left, 9 : Up Right


This topic has been resolved. If Roxas or any other users have any questions or further problems regarding this topic, please create a new thread about them.

Thank you!
 
Status
Not open for further replies.

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top