Me下的贪吃蛇小游戏(5)
headSanke.setPoint_Y(headSanke.getPoint_Y()-Snake_Direction.SNAKE_SIZE);
headSanke.setDirection(Snake_Direction.UP);
}
}
else
headSanke.setPoint_x(headSanke.getPoint_x()-Snake_Direction.SNAKE_SIZE);
}
else if(headSanke.getDirection()==Snake_Direction.DOWN||headSanke.getDirection()==Snake_Direction.DOWN_y)
{
if(headSanke.getPoint_Y()+Snake_Direction.SNAKE_SIZE>Canvas_Height-20)
{
if(headSanke.getPoint_x()-Snake_Direction.SNAKE_SIZE<1)
{
headSanke.setDirection(Snake_Direction.RIGHT) ;
headSanke.setPoint_x(headSanke.getPoint_x()+Snake_Direction.SNAKE_SIZE);
}
else
{
headSanke.setDirection(Snake_Direction.LEFT) ;
headSanke.setPoint_x(headSanke.getPoint_x()-Snake_Direction.SNAKE_SIZE);
}
}
else
headSanke.setPoint_Y(headSanke.getPoint_Y()+Snake_Direction.SNAKE_SIZE) ;
}
相关新闻>>
- 发表评论
-
- 最新评论 更多>>