Class: UI::MiningGame::Tiles_Stack

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

Overview

Class that describes the Tiles_Stack object

Constant Summary collapse

TEXTURE_LENGTH =

The length of the texture for each tile

Returns:

  • (Integer)
16
TEXTURE_WIDTH =

The length of the texture for each tile

Returns:

  • (Integer)
16

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>>)



542
543
# File 'docs/4_Systems_801_Mining_Game.rb', line 542

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



538
539
540
# File 'docs/4_Systems_801_Mining_Game.rb', line 538

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:



554
555
# File 'docs/4_Systems_801_Mining_Game.rb', line 554

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:



548
549
# File 'docs/4_Systems_801_Mining_Game.rb', line 548

def get_tile(x, y)
end

#texture_lengthInteger

Return the texture length

Returns:

  • (Integer)


558
559
# File 'docs/4_Systems_801_Mining_Game.rb', line 558

def texture_length
end

#texture_widthInteger

Return the texture width

Returns:

  • (Integer)


562
563
# File 'docs/4_Systems_801_Mining_Game.rb', line 562

def texture_width
end