package net.gfx;
public class TileSet {
public final int TILES = 627;
class Tiles {
int x = 0, y = 0;
int w = 0, h = 0;
}
public Tiles tiles[] = new Tiles[TILES];
public TileSet() {
for (int i = 0, y = 0; i < TILES; i++) {
for (int x = 0; x < 1280; x =+ 25) {
if (x > 1280) {
x = 0;
y += 40;
}
tiles[i] = new Tiles(); //Program Freezes here
tiles[i].x = x;
tiles[i].y = y;
tiles[i].w = 40;
tiles[i].h = 40;
}
}
}
}
我要做的基本上是在屏幕上创建一组图块。我已经修复了我在这里遇到的原始错误 Error Setting Object Array Values但现在当我运行它时它会冻结。代码中的更多细节。