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.

[Filled] Randomized Battler Flipping

Status
Not open for further replies.
To have add some originality.

Randomized Graphic Flipping

Flipping the Battler Graphic. Preferably defined my hashes. Should include a way to make a graphic be flipped on it's x axis(if math is involved)
 
Code:
class Sprite_Battler
  Randomly_Flipped_Actors = []
  Randomly_Flipped_Enemies = []
  alias_method :seph_flippedsprites_init, :initialize
  def initialize(viewport, battler = nil)
    seph_flippedsprites_init(viewport, battler)
    unless battler.nil?
      if (battler.is_a?(Game_Actor) && Randomly_Flipped_Actors.include?(battler.id)) ||
         (battler.is_a?(Game_Enemy) && Randomly_Flipped_Enemies.include?(battler.id))
        self.mirror = rand(2) == 0
      end
    end
  end
end

Insert somewhere below the rest of your scripts. Add actor ids into the Randomly_Flipped_Actors array and enemy ids in the Randomly_Flipped_Enemies array. If the battle appears in those arrays, it will randomly be flipped.
 
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