Rainbow Snake (one more Snake Game 🌈 )


Here is another version of the classic Snake made with p5js.

Rainbow Snake

Spacebar to skip the title screen and the movements are done with the arrows
It works on the phone by touching the top, bottom, right and left of the screen to move.

I intend to add small improvements to the gameplay with some options and bonus


Nice. Maybe you want to make an adaption for different screen sizes on my phone (1080x1920 pixels density 441ppi) it doesn’t fit.


Yes good idea ! I will try it !

eat(food) {
	if (food.x == this.snake[0].x && food.y == this.snake[0].y) {
		return true;
	} else {
		return false;

I can’t eat the food. Sometimes my snake’s center is at the corner of the food. Sometimes it is midway on an edge of the food.

1 Like

@TfGuy44 I saw this problem playing in landscape mode. Is this the case for you ?

@noel It’s strange. With such a resolution, the game should fit. The canvas adjusts itself to the size of the browser. The title take 704px.
For canvas auto-adjustment I use window.innerWidth and window.innerHeight. It may be a compatibility problem that causes this… Is there another way to use the full page ?

It’s now fixed :wink:

1 Like