Load in the rest of the sound assets.

This commit is contained in:
Matt Low 2019-12-25 16:26:25 +04:00
parent 0b2b7fac0f
commit 1a74c9aae3

View File

@ -18,15 +18,21 @@ public class Assets {
public TextureRegion[][] level;
public TextureRegion[][] chase;
public TextureRegion[][] death;
public TextureRegion[][] deathAnimation;
public TextureRegion[][] ghosts;
public TextureRegion[][] pacman;
public TextureRegion[][] points;
public TextureRegion[][] volume;
public Sound chomp_1, chomp_2;
public Sound siren;
public Sound beginning, beginning_alt;
public Sound chaseSound;
public Sound chomp_1, chomp_2;
public Sound deathSound;
public Sound eat_fruit, eat_ghost;
public Sound extra_life;
public Sound return_base;
public Sound siren, siren_fast, siren_faster, siren_fastest;
public Assets() {
this.manager = new AssetManager();
@ -44,11 +50,19 @@ public class Assets {
manager.load("sprites/points.png", Texture.class);
manager.load("sprites/volume.png", Texture.class);
manager.load("sounds/chomp_1.wav", Sound.class);
manager.load("sounds/chomp_2.wav", Sound.class);
manager.load("sounds/siren.wav", Sound.class);
manager.load("sounds/beginning.wav", Sound.class);
manager.load("sounds/beginning_alt.wav", Sound.class);
manager.load("sounds/chase.wav", Sound.class);
manager.load("sounds/chomp_1.wav", Sound.class);
manager.load("sounds/chomp_2.wav", Sound.class);
manager.load("sounds/death.wav", Sound.class);
manager.load("sounds/eat_fruit.wav", Sound.class);
manager.load("sounds/eat_ghost.wav", Sound.class);
manager.load("sounds/extra_life.wav", Sound.class);
manager.load("sounds/siren.wav", Sound.class);
manager.load("sounds/siren_fast.wav", Sound.class);
manager.load("sounds/siren_faster.wav", Sound.class);
manager.load("sounds/siren_fastest.wav", Sound.class);
// Yayyy! all of this to load a font
FileHandleResolver resolver = new InternalFileHandleResolver();
@ -66,18 +80,26 @@ public class Assets {
// cache our texture regions
level = TextureRegion.split(manager.get("sprites/level.png", Texture.class), 8, 8);
chase = TextureRegion.split(manager.get("sprites/chase.png", Texture.class), 16, 16);
death = TextureRegion.split(manager.get("sprites/death.png", Texture.class), 16, 16);
deathAnimation = TextureRegion.split(manager.get("sprites/death.png", Texture.class), 16, 16);
ghosts = TextureRegion.split(manager.get("sprites/ghosts.png", Texture.class), 16, 16);
pacman = TextureRegion.split(manager.get("sprites/pacman.png", Texture.class), 16, 16);
points = TextureRegion.split(manager.get("sprites/points.png", Texture.class), 16, 16);
volume = TextureRegion.split(manager.get("sprites/volume.png", Texture.class), 16, 16);
// all our sounds
chomp_1 = manager.get("sounds/chomp_1.wav", Sound.class);
chomp_2 = manager.get("sounds/chomp_2.wav", Sound.class);
siren = manager.get("sounds/siren.wav", Sound.class);
beginning = manager.get("sounds/beginning.wav", Sound.class);
beginning_alt = manager.get("sounds/beginning_alt.wav", Sound.class);
chaseSound = manager.get("sounds/chase.wav", Sound.class);
chomp_1 = manager.get("sounds/chomp_1.wav", Sound.class);
chomp_2 = manager.get("sounds/chomp_2.wav", Sound.class);
deathSound = manager.get("sounds/death.wav", Sound.class);
eat_fruit = manager.get("sounds/eat_fruit.wav", Sound.class);
eat_ghost = manager.get("sounds/eat_ghost.wav", Sound.class);
extra_life = manager.get("sounds/extra_life.wav", Sound.class);
siren = manager.get("sounds/siren.wav", Sound.class);
siren_fast = manager.get("sounds/siren_fast.wav", Sound.class);
siren_faster = manager.get("sounds/siren_faster.wav", Sound.class);
siren_fastest = manager.get("sounds/siren_fastest.wav", Sound.class);
}
public Texture getLevelBackground() {