How can I make this sound play every time the snake eats a square?

edited November 2016 in Library Questions

So i'm makin' a snake game as a project, and fortunately i'm almost there. The last thing I need is to make a sound every time the snake eats one of the random squares, but as it is right now, it only plays the sound the first time. How can I fix this?

Another thing I don't know how to do is to make a restart button for the game over screen. How can I make a function that makes the game start all over again as if you closed the window and run the code over again?

Project file here, and make sure to have the minim audio extension installed!


Sign In or Register to comment.