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.

Shake Screen?

Hey there, I'm trying to create a battle system that resembles old-stlye RPG's, such as Dragon Warrior. One of the main effects I want for that is the screen shaking when a player is hit. What would the command line be to make the screen shake?(if there even is one.) I want the whole screen shaking when a player is hit, Windows and everything. Thanks in advance!^_^
 
Well...

Code:
class Game_Battler
  alias_method :seph_damagescreenshake_gmbtlr_ae, :attack_effect
  alias_method :seph_damagescreenshake_gmbtlr_se, :skill_effect
  def attack_effect(attacker)
    r = seph_damagescreenshake_gmbtlr_ae(attacker)
    if self.damage.is_a?(Integer) && self.damage > 0
      $game_screen.start_shake(5, 5, 10)
    end
    return r
  end
  def skill_effect(user, skill)
    r = seph_damagescreenshake_gmbtlr_se
    if self.damage.is_a?(Integer) && self.damage > 0
      $game_screen.start_shake(5, 5, 10)
    end
    return r
  end
end

However, this doesn't shake everything. In fact, in battle, just the background. The only other way would be to cleverly modifying the Sprite, Window, etc. classes, to have them move depending on a global variable you set in $game_screen. Let me see what I can do. ;)
 
I have almost got something.

I went out it a complete new way, using the Sprite_Battler and RPG::Sprite class. Do you just want the sprite that was attacked to shake? To me that would make a slight more sense, and that is what I am working towards. If you want something else to shake, just let me know.

I'll have it done sometime soon. Just need to work out a kink in the code.
 

Anonymous

Guest

SephirothSpawn;296901 said:
Do you just want the sprite that was attacked to shake? To me that would make a slight more sense, and that is what I am working towards. If you want something else to shake, just let me know.

turtleman quote
I want the whole screen shaking when a player is hit, Windows and everything

Just letting you know.
 
SephirothSpawn;296901 said:
I have almost got something.

I went out it a complete new way, using the Sprite_Battler and RPG::Sprite class. Do you just want the sprite that was attacked to shake? To me that would make a slight more sense, and that is what I am working towards. If you want something else to shake, just let me know.

I'll have it done sometime soon. Just need to work out a kink in the code.

Enemy Shaking would be nice, I'm mainly looking for Windows shaking when the player is hit. I guess I shoulda also mentioned that there are no Hero Sprites. (Remember? Dragon Warrior-like system I'm working on?)
 
Well, I'm currently trying to work on an Action window, sorta like what tells ya what's going on during the battle, sorta how it was done in RM2000, or any Old RPG. I'll probably need help making that soon as well ;).
 
I can help you with that pretty easily. Give me tonight and I will start on something that is simple to adapt to your needs. I think I know just want to do to get any window to shake with just a simple line of code within the window class.

I'll be back with some answers for you.
 
Okay, So I got basically my whole battlesystem down except for the shacking part....come up with anything yet? Is there even a type of line of code in RGSS that performs a shake action?
 

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