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.

How do i make it where if i push S button it will activate a switch?

This will turn on or off the switch 5 when A (shift) is pressed :)
Code:
class Scene_Map

  alias upd_new update

  def update
    if Input.trigger?(Input::A)
      $game_switches[5] = (! $game_switches[5]) 
    end
    upd_new
  end
end
 
thanks dude, it works, lol. But what if i wanted more than 1 switches on?

oh and is it possible for you to give me the list of buttons, like, im rmxp

input::Y is S letter on keyboard, what are the rest? i know there are listed in the content help, but is there more?
 
About more switches...
Code:
class Scene_Map

  alias upd_new update

  def update
    if Input.trigger?(Input::A)
      $game_switches[5] = (! $game_switches[5])
      $game_switches[6] = (! $game_switches[6])
      $game_switches[7] = (! $game_switches[7]) 
    end
    upd_new
  end
end

And sorry about the keys, I forgot them XD
 

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