我确定外面有人可以在几秒钟内回答这个问题.
我想知道的是,这段代码是否是从下至上阅读的?评论说,这条蛇最初是向东走,然后向北走,当我跑它时,这句话是正确的.
但是坐标从7.7到6.7再到5.7,依此类推…那不是西行蛇吗?还是从下至上读取代码?
这是一段代码.
private void initNewGame() {
mSnakeTrail.clear();
mAppleList.clear();
// For Now we're just going to load up a short default eastbound snake
// that's just turned north
mSnakeTrail.add(new Coordinate(7, 7));
mSnakeTrail.add(new Coordinate(6, 7));
mSnakeTrail.add(new Coordinate(5, 7));
mSnakeTrail.add(new Coordinate(4, 7));
mSnakeTrail.add(new Coordinate(3, 7));
mSnakeTrail.add(new Coordinate(2, 7));
mNextDirection = norTH;
解决方法: