...
This commit is contained in:
parent
b6492202c2
commit
c947c4ac08
3 changed files with 36 additions and 25 deletions
|
@ -7,8 +7,14 @@
|
|||
<script src="vendors/jquery-1.11.1.min.js"></script>
|
||||
<script src="vendors/canvasquery.js"></script>
|
||||
<script src="vendors/playground.js"></script>
|
||||
<script src="app.js"></script>
|
||||
<style>
|
||||
html, body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<script src="app.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -1,9 +1,17 @@
|
|||
game = {
|
||||
start: ->
|
||||
|
||||
hud: ->
|
||||
app
|
||||
.layer
|
||||
.fillStyle "#00f"
|
||||
.fillRect 0, 0, 200, 50
|
||||
|
||||
|
||||
step: ->
|
||||
this.hud
|
||||
|
||||
resources:
|
||||
ore: 0
|
||||
ore: 50
|
||||
stone: 100
|
||||
}
|
||||
|
|
|
@ -1,25 +1,22 @@
|
|||
$ ->
|
||||
playground({
|
||||
width: 16*20,
|
||||
height: 16*20,
|
||||
scaleToFit: true,
|
||||
smoothing: false,
|
||||
app = playground({
|
||||
width: 16*20,
|
||||
height: 16*20,
|
||||
scaleToFit: true,
|
||||
smoothing: false,
|
||||
|
||||
create: ->
|
||||
# TODO: Load images
|
||||
createTestTiles: ->
|
||||
testTile1 = new Tile
|
||||
testTile2 = new Tile
|
||||
|
||||
@createTestTiles()
|
||||
create: ->
|
||||
@createTestTiles()
|
||||
|
||||
createTestTiles: ->
|
||||
testTile1 = new Tile
|
||||
testTile2 = new Tile
|
||||
ready: ->
|
||||
game.start
|
||||
@setState game
|
||||
|
||||
ready: ->
|
||||
game.start
|
||||
this.setState(game)
|
||||
step: ->
|
||||
|
||||
step: ->
|
||||
|
||||
render: ->
|
||||
this.layer.clear("#333");
|
||||
render: ->
|
||||
this.layer.clear("#000");
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue