Class: Battle::Visual::IdlePokemonAnimation
- Defined in:
- scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01000 IdlePokemonAnimation.rb
Constant Summary collapse
- OFFSET_SPRITE =
Pixel offset for each index of the sprite
[0, 1, 2, 3, 4, 5, 5, 4, 3, 2, 1, 0]
- OFFSET_BAR =
Pixel offset for each index of the bar
[0, -1, -2, -3, -4, -5, -5, -4, -3, -2, -1, 0]
Instance Method Summary collapse
-
#initialize(visual, pokemon, bar) ⇒ IdlePokemonAnimation
constructor
Create a new IdlePokemonAnimation.
-
#remove
Function that rmoves the idle animation from the visual.
-
#update
Function that updates the idle animation.
Constructor Details
#initialize(visual, pokemon, bar) ⇒ IdlePokemonAnimation
Create a new IdlePokemonAnimation
12 13 14 15 16 17 18 19 20 21 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01000 IdlePokemonAnimation.rb', line 12 def initialize(visual, pokemon, ) @visual = visual @pokemon = pokemon # @type [Array<Integer>] @pokemon_origin = pokemon.send(:sprite_position) @bar = # @type [Array<Integer>] @bar_origin = .send(:sprite_position) @animation = create_animation end |
Instance Method Details
#remove
Function that rmoves the idle animation from the visual
29 30 31 32 33 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01000 IdlePokemonAnimation.rb', line 29 def remove @pokemon.y = @pokemon_origin.last if @pokemon.in? @bar.y = @bar_origin.last if @bar.in? @visual.parallel_animations.delete(self.class) end |
#update
Function that updates the idle animation
24 25 26 |
# File 'scripts/01600 Alpha 25 Battle Engine/00002 Battle_Visual/00001 Animations/01000 IdlePokemonAnimation.rb', line 24 def update @animation.update end |