Class: UI::MiningGame::Hit_Counter_Stack

Inherits:
SpriteStack show all
Defined in:
docs/4_Systems_801_Mining_Game.rb

Overview

Class that describes the SpriteStack containing all the Hit_Counter_Sprite

Constant Summary collapse

COORD_X =

X Coordinates of first and second Hit_Counter_Sprite

[206, 182]
SPACE_BETWEEN_CRACKS =

The X space between all Hit_Counter_Sprite (except first and second)

24
COORD_Y =

Y Coordinates of first and every other Hit_Counter_Sprite

[0, 2]
NUMBER_OF_CRACKS =

Max number of Cracks

10
MAX_NB_HIT =

Max number of hits the wall can take

61

Constants inherited from SpriteStack

SpriteStack::NO_INITIAL_IMAGE

Instance Attribute Summary collapse

Attributes inherited from SpriteStack

#animated, #data, #font_id, #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) ⇒ Hit_Counter_Stack

Create the Hit_Counter_Stack

Parameters:

  • viewport (Viewport) —

    the viewport of the scene



470
471
# File 'docs/4_Systems_801_Mining_Game.rb', line 470

def initialize(viewport)
end

Instance Attribute Details

#nb_hit ⇒ Integer

Returns the current number of hit.

Returns:

  • (Integer) —

    the current number of hit



467
468
469
# File 'docs/4_Systems_801_Mining_Game.rb', line 467

def nb_hit
  @nb_hit
end

Instance Method Details

#max_cracks? ⇒ Boolean

Check if the current number of hits is equal the max amount of hit

Returns:

  • (Boolean)


478
479
# File 'docs/4_Systems_801_Mining_Game.rb', line 478

def max_cracks?
end

#send_hit(reason)

Method that send the correct number of hits

Parameters:

  • reason (Symbol) —

    the symbol of the tool used to hit



474
475
# File 'docs/4_Systems_801_Mining_Game.rb', line 474

def send_hit(reason)
end