Class: UI::MiningGame::Tiles_Stack

Inherits:
SpriteStack show all
Defined in:
docs/01450_Systems_08001_Mining_Game.rb

Overview

Class that describes the Tiles_Stack object

Constant Summary

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, arr) ⇒ Tiles_Stack

Create the Tiles_Stack

Parameters:

  • viewport (Viewport)

    the viewport of the scene

  • arr (Array<Array<Integer>>)

    the array containing the arrays containing the tiles (columns<lines<tiles state>>)



536
537
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 536

def initialize(viewport, arr)
end

Instance Attribute Details

#tile_arrayArray<UI::MiningGame::Tiles] the array containing all the Tiles sprite

Returns Array<UI::MiningGame::Tiles] the array containing all the Tiles sprite.

Returns:

  • (Array<UI::MiningGame::Tiles] the array containing all the Tiles sprite)

    Array<UI::MiningGame::Tiles] the array containing all the Tiles sprite



532
533
534
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 532

def tile_array
  @tile_array
end

Instance Method Details

#get_adjacent_of(x, y) ⇒ Array<UI::MiningGame::Tiles>

Get the Tiles sprite adjacent to the one at given coordinates

Parameters:

  • x (Integer)
  • y (Integer)

Returns:



548
549
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 548

def get_adjacent_of(x, y)
end

#get_tile(x, y) ⇒ UI::MiningGame::Tiles

Get the Tiles sprite at given coordinates

Parameters:

  • x (Integer)
  • y (Integer)

Returns:



542
543
# File 'docs/01450_Systems_08001_Mining_Game.rb', line 542

def get_tile(x, y)
end