Class: SDC::MapLayer

Inherits:
Object
  • Object
show all
Defined in:
engine_docs/automatic_doc_MapLayer.rb,
lib/core/Map.rb,
engine_docs/automatic_doc_MapLayer.rb

Overview

Single layer of a map

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(width, height, view_width, view_height, tile_width, tile_height) ⇒ MapLayer

Creates a map layer with given size, the view field size and the tile size

Parameters:

  • width (Integer)
  • height (Integer)
  • view_width (Integer)
  • view_height (Integer)
  • tile_width (Integer)
  • tile_height (Integer)


# File 'engine_docs/automatic_doc_MapLayer.rb', line 9

Instance Attribute Details

#collision_activeBoolean

Tests collisions if set to true

Returns:

  • (Boolean)


# File 'engine_docs/automatic_doc_MapLayer.rb', line 36

#tilesetTileset

The tileset of the map

Returns:



# File 'engine_docs/automatic_doc_MapLayer.rb', line 47

#zObject

Returns the value of attribute z.



3
4
5
# File 'lib/core/Map.rb', line 3

def z
  @z
end

Instance Method Details

#[](x, y) ⇒ Tile

Gives the tile at the given indices on the map

Parameters:

  • x

    Integer

  • y

    Integer

Returns:



# File 'engine_docs/automatic_doc_MapLayer.rb', line 40

Links the given tileset to the map layer

Parameters:

Returns:

  • (nil)


# File 'engine_docs/automatic_doc_MapLayer.rb', line 30

#load_test_mapnil

Loads a simple test map

Returns:

  • (nil)


# File 'engine_docs/automatic_doc_MapLayer.rb', line 25

#reloadtrue

Reloads the map

Returns:

  • (true)


# File 'engine_docs/automatic_doc_MapLayer.rb', line 20