One day, I just said to me: why not to make snake controlled with a joystick - so I asked ChatGPT about the project.
And, it said there is a library for it, called pygame.joystick.
So I asked again, how to use it. Here is a quick overview of it:
It uses axes zero and one(axes of the joystick, I do not have an axe) to control it.
I created tree levels of difficulty: Easy, Medium and Hard.
In reality, it is something like Hard, Ultra Hard and Impossible.
That is because when you click on the keyboard, it does the turn instantly, but with the joystick it takes a bit longer.
You need some practice and great reaction time, I have around 300ms idk if it is good and idc if it is good
warning: 100% text readability
sorry for the low quality also do not look into the source code NO I DO NOT HAVE TTIME FOR PUTTING THERE A MILION OF FILE TYPES
Maybe, I should try using throttles. 1RPM all time i guess
Fun fact: Maybe you know but the little joystick on the joystick is a hat switch - and you can control your view. It is kinda nice actually.
Source code of the snake game is here.
← Back to Blog