Implement sound-playing API

There's no playSoundEffect-equivalent method in the actual client code.
Instead, the client just adds some values to the 4 sfx arrays, removes
any old queued sound effects, and then bumps the counter, which is what
I've done as well.
This commit is contained in:
SomeoneWithAnInternetConnection
2018-01-21 00:56:09 -05:00
parent 7d5e0ff389
commit 560b169e68
4 changed files with 133 additions and 0 deletions

View File

@@ -177,5 +177,24 @@ public interface Client extends GameEngine
List<Projectile> getProjectiles();
/**
* Play a sound effect at the player's current location.
* This is how UI, and player-generated (e.g. mining, woodcutting) sound effects are normally played
*
* @param id the ID of the sound to play
*/
void playSoundEffect(int id);
/**
* Play a sound effect from some point in the world.
*
* @param id the ID of the sound to play
* @param x the ground coordinate on the x axis
* @param y the ground coordinate on the y axis
* @param range the number of tiles away that the sound can be heard from
*/
void playSoundEffect(int id, int x, int y, int range);
BufferProvider getBufferProvider();
}