Game Development Asked by Düsüngülü Tibor on November 12, 2021
I am using Android studio (libGDX), and I can’t figure out why alternative paths doesn’t work. I’ve tried it as it said in the book, but it doesn’t do anything, it shows a black window and than the program exterminates.
If the .png file would be in the …/android/assets/ folder, it wouldn’t work either.
Book: Java Game Development with LibGDX 2nd edition
This is what the book wants me to do it:
public Spaceship(float x, float y, Stage s){
super(x,y,s);
loadTexture( "assets/spaceship.png" );
setBoundaryPolygon(8);
setAcceleration(200);
setMaxSpeed(100);
setDeceleration(10);
}
This is the shortest form that works for me:
public Spaceship(float x, float y, Stage stage) {
super(x, y, stage);
loadTexture("core/src/com/dusi/game/ch04/assets/spaceship.png");
setBoundaryPolygon(8);
setAcceleration(400);
setMaxSpeed(200);
setDeceleration(20);
}
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP