le code est jste plus beau

This commit is contained in:
Damien 2021-05-12 19:35:34 +02:00
parent 1770a819bf
commit 61924b85b6
2 changed files with 2 additions and 10 deletions

View file

@ -51,10 +51,7 @@ public class Arrow extends EntityQuad {
this.landed = false; this.landed = false;
Random random = new Random(); Random random = new Random();
Pixmap pm = new Pixmap(new FileHandle(new String[] { Pixmap pm = new Pixmap(new FileHandle("core/assets/arrow" + (random.nextInt(2) + 1) + ".png"));
"core/assets/arrow1.png",
"core/assets/arrow2.png"
}[random.nextInt(2)]));
pm.setBlending(Pixmap.Blending.None); pm.setBlending(Pixmap.Blending.None);
for (int x = 0; x < pm.getWidth(); x++) { for (int x = 0; x < pm.getWidth(); x++) {

View file

@ -23,12 +23,7 @@ public class Planet extends EntityCircle {
super(0, mass, color, position, radius); super(0, mass, color, position, radius);
Random random = new Random(); Random random = new Random();
Pixmap pm = new Pixmap(new FileHandle(new String[] { Pixmap pm = new Pixmap(new FileHandle("core/assets/planet" + random.nextInt(5) + ".png"));
"core/assets/planet1.png",
"core/assets/planet2.png",
"core/assets/planet3.png",
"core/assets/planet4.png"
}[random.nextInt(4)]));
pm.setBlending(Pixmap.Blending.None); pm.setBlending(Pixmap.Blending.None);
for (int x = 0; x < pm.getWidth(); x++) { for (int x = 0; x < pm.getWidth(); x++) {