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.

More Event tests

How can I test if an event is passable? For example, invisible graphics are passable, and events that you set as "Through" are passable, so how would I test for this in a script?
 
A simple test to test if something can move to a position is
Code:
game_character.passable?(game_character.x, game_character.y, direction)
# Directions : 2 - Down, 4 - Left, 6 - Right, 8 - Up


I guess if you wanted to test if you can pass through some event, you can add this method in Game_Character 1 before the final end.
Code:
  def can_pass_through?
    return self.through || (@character_name == '' && self != $game_player)
  end

Then to test if you can pass through an event, just use:
Code:
if game_event.can_pass_through?

Either way I guess.
 

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