Start work on the entities...
This commit is contained in:
parent
45ff398815
commit
b6492202c2
4 changed files with 31 additions and 0 deletions
|
@ -0,0 +1,3 @@
|
|||
class Base_entity
|
||||
constructor: (options) ->
|
||||
{} = options
|
19
src/entities/tile.coffee
Normal file
19
src/entities/tile.coffee
Normal file
|
@ -0,0 +1,19 @@
|
|||
class Tile extends Base_entity
|
||||
constructor: (options) ->
|
||||
super options
|
||||
|
||||
@layers = [
|
||||
new Tilelayer type: 'grass'
|
||||
new Tilelayer type: 'mud'
|
||||
new Tilelayer type: 'gravel'
|
||||
new Tilelayer type: 'stone'
|
||||
new Tilelayer type: 'gold'
|
||||
]
|
||||
|
||||
console.log @layers
|
||||
|
||||
tick: (delta) ->
|
||||
# TODO: digging deeper?
|
||||
|
||||
render: ->
|
||||
# TODO: render me
|
3
src/entities/tilelayer.coffee
Normal file
3
src/entities/tilelayer.coffee
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Tilelayer extends Base_entity
|
||||
constructor: (options) ->
|
||||
{@type, @depth, @amount} = options
|
|
@ -8,6 +8,12 @@ $ ->
|
|||
create: ->
|
||||
# TODO: Load images
|
||||
|
||||
@createTestTiles()
|
||||
|
||||
createTestTiles: ->
|
||||
testTile1 = new Tile
|
||||
testTile2 = new Tile
|
||||
|
||||
ready: ->
|
||||
game.start
|
||||
this.setState(game)
|
||||
|
|
Loading…
Reference in a new issue