Witam. Potrzebuję pomocy, ponieważ chcę aby po odpaleniu kodu postać zaczęła strzelać w linii prostej, żeby to było od razu po włączeniu gry, a nie naciśnięciu jakiegoś przycisku.
public class Main extends ApplicationAdapter {
private SpriteBatch batch;
private Texture texture;
ArrayList<Bullet> bulletList=new ArrayList<Bullet>();
@Override
public void create () {
batch = new SpriteBatch();
texture=new Texture("dummy.png");
}
@Override
public void render () {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
batch.begin();
batch.draw(texture, 850+texture.getWidth()/2, 50);
batch.end();
}
@Override
public void dispose () {
batch.dispose();
texture.dispose();
}
}
public class Bullet {
Texture texture;
public Bullet(int x,int y){
texture=new Texture("badlogic.jpg");
}
public void update(float delta){
}
public void draw(SpriteBatch spriteBatch){
spriteBatch.draw(texture,50,50,texture.getHeight(),texture.getWidth());
}
}
na razie mam takie coś xd
Trochę przeglądnąłem internetu i no nie wiem jak to napisać.