6/12/2023 0 Comments Snake java![]() Which will eventually make a sound when the snake moves from tile to tile. However, I can only get this to work in the onCreate method in the Snake class.Īs of right now I only have the one MediaPlayer object declared mpOver. Then set the object to the raw file by: mpOver.create(Snake.this, R.raw.bump) Īnd then triggering the sound in a method by: mpOver.start() ![]() I've tried to use the MediaPlayer class to create a MediaPlayer object for each sound: MediaPlayer mpOver = new MediaPlayer() The code I believe is the same or nearly the same that is available on GitHub. ![]() I'm trying to modify the Snake game code to trigger a sound for the following:
0 Comments
Leave a Reply. |