-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSpriteManager.java
More file actions
78 lines (58 loc) · 2.09 KB
/
Copy pathSpriteManager.java
File metadata and controls
78 lines (58 loc) · 2.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package puppy.code;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.utils.Disposable;
import com.badlogic.gdx.audio.Sound;
import com.badlogic.gdx.Gdx;
public class SpriteManager implements Disposable {
private static SpriteManager instance;
public static SpriteManager getInstance() {
if (instance == null) {
instance = new SpriteManager();
}
return instance;
}
public Texture tarro; // ← tu único tarro
public Texture gotaBuena;
public Texture gotaMala;
public Texture gotaPower;
public Texture fondoMenu;
public Texture fondoJuegoTarde;
public Texture fondoJuegoNoche;
public Texture fondoJuegoMañana;
public Texture pausa;
public Sound sonidoGotaBuena;
public Sound sonidoGotaMala;
public Sound sonidoGotaPower;
private SpriteManager() {
cargarSprites();
}
private void cargarSprites() {
gotaBuena = new Texture("drop.png");
gotaMala = new Texture("dropBad.png");
gotaPower = new Texture("gotaPower.jpg");
fondoMenu = new Texture("menu_background1.png");
fondoJuegoMañana = new Texture("background_day.png");
fondoJuegoTarde = new Texture("background_evening.png");
fondoJuegoNoche = new Texture("background_night.png");
pausa = new Texture("pause_background.png");
tarro = new Texture("bucket.png"); // ← tu textura única
sonidoGotaBuena = Gdx.audio.newSound(Gdx.files.internal("drop.wav"));
sonidoGotaMala = Gdx.audio.newSound(Gdx.files.internal("hurt.ogg"));
sonidoGotaPower = Gdx.audio.newSound(Gdx.files.internal("powerup.mp3"));
}
@Override
public void dispose() {
tarro.dispose();
gotaBuena.dispose();
gotaMala.dispose();
gotaPower.dispose();
fondoMenu.dispose();
fondoJuegoMañana.dispose();
fondoJuegoTarde.dispose();
fondoJuegoNoche.dispose();
pausa.dispose();
sonidoGotaBuena.dispose();
sonidoGotaMala.dispose();
sonidoGotaPower.dispose();
}
}