Skip to content

Commit

Permalink
update method _getGridAround
Browse files Browse the repository at this point in the history
  • Loading branch information
neekey committed Jun 15, 2011
1 parent a21c48e commit fd9617a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crafty/playerWalk.js
Expand Up @@ -448,9 +448,8 @@ Crafty.c( 'playerGridWalk', {
grids[ 2 ].y = cur.y + 1;
grids[ 3 ].y = grids[ 2 ].y;
// 获取 格子0的x轴坐标
grids[ 0 ].x = ( cur.y % 2 == 0 ) ? cur.x - 1 : cur.x;
grids[ 0 ].x = grids[ 0 ].x < 0 ? 0 : grids[ 0 ].x;
grids[ 1 ].x = grids[ 0 ].x + 1;
grids[ 0 ].x = ( cur.x - 1 ) < 0 ? 0 : cur.x - 1;
grids[ 1 ].x = cur.x + 1
grids[ 2 ].x = grids[ 1 ].x;
grids[ 3 ].x = grids[ 0 ].x;

Expand Down

0 comments on commit fd9617a

Please sign in to comment.