Me下的贪吃蛇小游戏(4)
{
if(headSanke.getPoint_Y()-Snake_Direction.SNAKE_SIZE<0)
{
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) ;
}
else if(headSanke.getDirection()==Snake_Direction.LEFT||headSanke.getDirection()==Snake_Direction.LEFT_x)
{
if(headSanke.getPoint_x()-Snake_Direction.SNAKE_SIZE<1)
{
if(headSanke.getPoint_Y()-Snake_Direction.SNAKE_SIZE<1)
{
headSanke.setPoint_Y(headSanke.getPoint_Y()+Snake_Direction.SNAKE_SIZE);
headSanke.setDirection(Snake_Direction.DOWN);
}
else
相关新闻>>
- 发表评论
-
- 最新评论 更多>>