This commit is contained in:
Aaron Mueller 2014-12-06 09:24:36 +01:00
parent b6492202c2
commit c947c4ac08
3 changed files with 36 additions and 25 deletions

View file

@ -7,8 +7,14 @@
<script src="vendors/jquery-1.11.1.min.js"></script> <script src="vendors/jquery-1.11.1.min.js"></script>
<script src="vendors/canvasquery.js"></script> <script src="vendors/canvasquery.js"></script>
<script src="vendors/playground.js"></script> <script src="vendors/playground.js"></script>
<script src="app.js"></script> <style>
html, body {
margin: 0;
padding: 0;
}
</style>
</head> </head>
<body> <body>
<script src="app.js"></script>
</body> </body>
</html> </html>

View file

@ -1,9 +1,17 @@
game = { game = {
start: -> start: ->
hud: ->
app
.layer
.fillStyle "#00f"
.fillRect 0, 0, 200, 50
step: -> step: ->
this.hud
resources: resources:
ore: 0 ore: 50
stone: 100 stone: 100
} }

View file

@ -1,25 +1,22 @@
$ -> app = playground({
playground({ width: 16*20,
width: 16*20, height: 16*20,
height: 16*20, scaleToFit: true,
scaleToFit: true, smoothing: false,
smoothing: false,
create: -> createTestTiles: ->
# TODO: Load images testTile1 = new Tile
testTile2 = new Tile
@createTestTiles() create: ->
@createTestTiles()
createTestTiles: -> ready: ->
testTile1 = new Tile game.start
testTile2 = new Tile @setState game
ready: -> step: ->
game.start
this.setState(game)
step: -> render: ->
this.layer.clear("#000");
render: ->
this.layer.clear("#333");
}) })