Class: UI::Hall_of_Fame::Party_Battler_Stack
- Inherits:
-
SpriteStack
- Object
- SpriteStack
- UI::Hall_of_Fame::Party_Battler_Stack
- Defined in:
- scripts/01450 Systems/00300 Hall of fame/00002 UI/00021 Party_Battler_Stack.rb
Overview
Class that define the Party Battler stack
Constant Summary collapse
- X_PARTY =
[99, 221, 69, 251, 38, 282]
- Y_PARTY =
[180, 150, 120]
- Y_TRAINER =
102
- PLAYER_SPRITE_NAME =
{ true => 'hall_of_fame/female', false => 'hall_of_fame/male' }
Constants inherited from SpriteStack
Instance Attribute Summary collapse
-
#pokemon_arr ⇒ Array<UI::PokemonFaceSprite>
The Array containing the front battlers of the Pokemon.
-
#trainer_battler ⇒ Sprite
The trainer battler.
Attributes inherited from SpriteStack
#animated, #data, #moving, #stack, #viewport, #x, #y
Instance Method Summary collapse
-
#initialize(viewport) ⇒ Party_Battler_Stack
constructor
Initialize the SpriteStack.
-
#pkm_initial_coordinates(index) ⇒ Array<Integer>
The Pokemon initial coordinates.
-
#trainer_initial_coordinates ⇒ Array<Integer>
The trainer sprite initial coordinates.
Methods inherited from SpriteStack
#[], #add_background, #add_line, #add_text, #anime, #anime_delta_set, #dispose, #each, #execute_anime, #move, #move_to, #opacity, #opacity=, #push, #push_sprite, #set_origin, #set_position, #simple_mouse_in?, #size, #stop_animation, #translate_mouse_coords, #update, #update_animation, #update_position, #visible, #visible=, #with_cache, #with_font, #with_surface, #z, #z=
Constructor Details
#initialize(viewport) ⇒ Party_Battler_Stack
Initialize the SpriteStack
17 18 19 20 21 22 23 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00021 Party_Battler_Stack.rb', line 17 def initialize() super() @pokemon_arr = Array.new($actors.size) { |i| add_sprite(*pkm_initial_coordinates(i), NO_INITIAL_IMAGE, type: PokemonFaceSprite) } @pokemon_arr.reverse! @trainer_battler = add_sprite(*trainer_initial_coordinates, PLAYER_SPRITE_NAME[$trainer.]) @pokemon_arr.each_with_index { |sprite, index| sprite.data = ($actors[index]) } end |
Instance Attribute Details
#pokemon_arr ⇒ Array<UI::PokemonFaceSprite>
The Array containing the front battlers of the Pokemon
7 8 9 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00021 Party_Battler_Stack.rb', line 7 def pokemon_arr @pokemon_arr end |
#trainer_battler ⇒ Sprite
The trainer battler
10 11 12 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00021 Party_Battler_Stack.rb', line 10 def trainer_battler @trainer_battler end |
Instance Method Details
#pkm_initial_coordinates(index) ⇒ Array<Integer>
The Pokemon initial coordinates
27 28 29 30 31 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00021 Party_Battler_Stack.rb', line 27 def pkm_initial_coordinates(index) x = index.even? ? -48 : 368 y = Y_PARTY[index / 2] return x, y end |
#trainer_initial_coordinates ⇒ Array<Integer>
The trainer sprite initial coordinates
35 36 37 |
# File 'scripts/01450 Systems/00300 Hall of fame/00002 UI/00021 Party_Battler_Stack.rb', line 35 def trainer_initial_coordinates return 112, -96 end |