Class: UI::Hall_of_Fame::Party_Battler_Stack

Inherits:
SpriteStack show all
Defined in:
scripts/01300 UI/02000 Hall_Of_Fame/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

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from SpriteStack

#animated, #data, #moving, #stack, #viewport, #x, #y

Instance Method Summary collapse

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

Parameters:



17
18
19
20
21
22
23
# File 'scripts/01300 UI/02000 Hall_Of_Fame/00021 Party_Battler_Stack.rb', line 17

def initialize(viewport)
  super(viewport)
  @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.playing_girl])
  @pokemon_arr.each_with_index { |sprite, index| sprite.data = ($actors[index]) }
end

Instance Attribute Details

#pokemon_arrArray<UI::PokemonFaceSprite>

The Array containing the front battlers of the Pokemon

Returns:



7
8
9
# File 'scripts/01300 UI/02000 Hall_Of_Fame/00021 Party_Battler_Stack.rb', line 7

def pokemon_arr
  @pokemon_arr
end

#trainer_battlerSprite

The trainer battler

Returns:



10
11
12
# File 'scripts/01300 UI/02000 Hall_Of_Fame/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

Returns:

  • (Array<Integer>)

    the coordinates



27
28
29
30
31
# File 'scripts/01300 UI/02000 Hall_Of_Fame/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_coordinatesArray<Integer>

The trainer sprite initial coordinates

Returns:

  • (Array<Integer>)

    the coordinates



35
36
37
# File 'scripts/01300 UI/02000 Hall_Of_Fame/00021 Party_Battler_Stack.rb', line 35

def trainer_initial_coordinates
  return 112, -96
end