I am currently trying to make a game that involves a randomly generated world. I currently have a working splash screen and a working perlin noise gen with it normalized. all i need is a way to implement the code to display the images.
the code:
public void show() {
batch = new SpriteBatch();
World world = new World();
int type = 0;
for (int y = 1; y < world.getlengthy();y++){
for (int x = 1; x < world.getlengthx();x++){
type = world.getvalue(x, y);
switch (type) {
case 1:sprite = new Sprite(tex1,0,0,16,16);sprite.setPosition(x, y);batch.begin();sprite.draw(batch);batch.end();
Gdx.app.log("", "x: " + x + " y: " + y);
break;
case 2:batch.begin();batch.draw(tex2, x, y);batch.end();
break;
case 3:batch.begin();batch.draw(tex3, x, y);batch.end();
break;
case 4:batch.begin();batch.draw(tex4, x, y);batch.end();
break;
case 5:batch.begin();batch.draw(tex5, x, y);batch.end();
break;
case 6:batch.begin();batch.draw(tex6, x, y);batch.end();
break;
case 7:batch.begin();batch.draw(tex7, x, y);batch.end();
break;
case 8:batch.begin();batch.draw(tex8, x, y);batch.end();
break;
}
}