Quantcast
Channel: Library Questions - Processing 2.x and 3.x Forum
Viewing all articles
Browse latest Browse all 2896

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

$
0
0

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!

http://www.filedropper.com/snake_2


Viewing all articles
Browse latest Browse all 2896

Trending Articles