()
| 42 | long startTime = TimeUtils.nanoTime(); |
| 43 | |
| 44 | @Override |
| 45 | public void create () { |
| 46 | cam = new OrthographicCamera(480, 320); |
| 47 | cam.position.set(WIDTH * 32 / 2, HEIGHT * 32 / 2, 0); |
| 48 | camController = new OrthoCamController(cam); |
| 49 | Gdx.input.setInputProcessor(camController); |
| 50 | |
| 51 | texture = new Texture(Gdx.files.internal("data/tiles.png")); |
| 52 | |
| 53 | Random rand = new Random(); |
| 54 | for (int i = 0; i < LAYERS; i++) { |
| 55 | caches[i] = new SpriteCache(); |
| 56 | SpriteCache cache = caches[i]; |
| 57 | cache.beginCache(); |
| 58 | for (int y = 0; y < HEIGHT; y++) { |
| 59 | for (int x = 0; x < WIDTH; x++) { |
| 60 | int tileX = rand.nextInt(5); |
| 61 | int tileY = rand.nextInt(5); |
| 62 | cache.add(texture, x << 5, y << 5, 1 + tileX * 33, 1 + tileY * 33, 32, 32); |
| 63 | } |
| 64 | } |
| 65 | layers[i] = cache.endCache(); |
| 66 | } |
| 67 | |
| 68 | } |
| 69 | |
| 70 | @Override |
| 71 | public void render () { |
nothing calls this directly
no test coverage detected