Skip to content
ā† Back to Community
šŸ SNAKE in C++ (OpenGL)
Profile icon
CSharpIsGud

This is a game of snake made in C++, replit does not support opengl so to play it you have to compile it locally g++ main.cpp -lglut -lGL -lpthread

It has some bugs, avoid the walls as if you go too far the game will segfault!

P.S Created with freeglut3

Voters
Profile icon
ahmadhabibshovo
Profile icon
z80
Profile icon
Highwayman
Profile icon
Billytahiroutah
Profile icon
xolyon
Profile icon
CodeSalvageON
Profile icon
CSharpIsGud
Comments
hotnewtop
Profile icon
Highwayman

Update: repl.it does support both gl and glfw, so you could get this to work probably with very little changes seeing as Iā€™m guessing freeglut is based off of gl and so is glfw? Also this is sick

Profile icon
xolyon

found a bug - include <GL/freeglut.h - this code doesn't exist apparently and due to this won't run :(

Profile icon
CSharpIsGud

@xolyon not a bug, you need to have freeglut3 installed. I developed this on a linux based laptop so its probably not easy to get going in windows