mirror of
https://github.com/flynx/Course-JavaScript.git
synced 2025-10-29 02:50:09 +00:00
notes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
e54ec2c052
commit
b927992e7f
@ -14,6 +14,7 @@
|
||||
<script>
|
||||
|
||||
// XXX add random apple and snake placement + avoid walls and other stuff...
|
||||
// XXX normalize x/y everywhere we input coordinates...
|
||||
var Snake = {
|
||||
config: {
|
||||
apple_color: 'red',
|
||||
@ -134,6 +135,7 @@ var Snake = {
|
||||
},
|
||||
|
||||
// constructors...
|
||||
// XXX normalize input x/y...
|
||||
snake: function(color, x, y, direction, age){
|
||||
var head = this._cells[x + y * this.field_size.width]
|
||||
|
||||
@ -231,7 +233,7 @@ function setup(){
|
||||
Snake
|
||||
.setup('.snake')
|
||||
// setup base level...
|
||||
.wall(2, 14, 's', 7)
|
||||
.wall(2, 10, 's', 11)
|
||||
.wall(2, 5, 'e', 5)
|
||||
.wall(2+5, 5, 's', 5)
|
||||
.wall(2+5, 5+4, 'e', 12)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user