Start work on the entities...

This commit is contained in:
Ruben Müller 2014-12-06 09:16:55 +01:00
parent 45ff398815
commit b6492202c2
4 changed files with 31 additions and 0 deletions

View file

@ -0,0 +1,3 @@
class Base_entity
constructor: (options) ->
{} = options

19
src/entities/tile.coffee Normal file
View 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

View file

@ -0,0 +1,3 @@
class Tilelayer extends Base_entity
constructor: (options) ->
{@type, @depth, @amount} = options

View file

@ -8,6 +8,12 @@ $ ->
create: ->
# TODO: Load images
@createTestTiles()
createTestTiles: ->
testTile1 = new Tile
testTile2 = new Tile
ready: ->
game.start
this.setState(game)