Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2017-04-05 19:06:13 +03:00
parent e54ec2c052
commit b927992e7f

View File

@ -14,6 +14,7 @@
<script> <script>
// XXX add random apple and snake placement + avoid walls and other stuff... // XXX add random apple and snake placement + avoid walls and other stuff...
// XXX normalize x/y everywhere we input coordinates...
var Snake = { var Snake = {
config: { config: {
apple_color: 'red', apple_color: 'red',
@ -134,6 +135,7 @@ var Snake = {
}, },
// constructors... // constructors...
// XXX normalize input x/y...
snake: function(color, x, y, direction, age){ snake: function(color, x, y, direction, age){
var head = this._cells[x + y * this.field_size.width] var head = this._cells[x + y * this.field_size.width]
@ -231,7 +233,7 @@ function setup(){
Snake Snake
.setup('.snake') .setup('.snake')
// setup base level... // setup base level...
.wall(2, 14, 's', 7) .wall(2, 10, 's', 11)
.wall(2, 5, 'e', 5) .wall(2, 5, 'e', 5)
.wall(2+5, 5, 's', 5) .wall(2+5, 5, 's', 5)
.wall(2+5, 5+4, 'e', 12) .wall(2+5, 5+4, 'e', 12)