Dev Log #1 - Getting Started...
Creating a snake clone for the Clone Jam entry has begun! I have made snake clones before in a few different languages and environments. It’s a great project for getting to know a language or framework! I originally created a snake clone with some extra mechanics in Lua LOVE. I thought it would be a nice next step from developing games with PICO-8. I would have created the game with PICO-8 if I had been working alone, but my friend is an artist by trade and I want them to be able to use the tools they are most familiar with to create the artwork within the deadline.
Lua LOVE issues…
After some online research I found out that porting a Lua LOVE game to the web is a pain in the ass… It CAN be done, but it is not a smooth process and doesn’t have much support at the moment. This is a bit of a bummer, but I decided to look into other options before committing to a language/framework. I want the game to be playable in the browser as it makes it way more likely that people will give the game a try on itch.io once we have submitted our entry.
Stick with what you know
My next thought was to use Python and the PyGame library. I have used it before to make a snake clone, and it is pretty robust. I want to avoid using Unity, Unreal Engine, Defold, Godot, etc… because I don’t think I will have the time to learn how they work and get the game made before the deadline. I have always made games for fun in PICO-8, PyGame, the terminal, Lua LOVE, and a couple other fantasy consoles like TIC-80. My experience with Defold was positive (another Lua based platform), but I don’t feel like I can learn how it works while creating for a jam that I am collaborating on. If the game was more complex then I would probably go all in with a proper game engine, but for this project I am going to see how far I can push PyGame, especially if I am getting great assets from my partner in crime!
Structuring the project
Because I am a bit of a bad boy 😏 I never really use Python virtual environments. However, for this project I thought I’d give them another try. I am using Windows Subsystem for Linux (WSL2) and want to keep the project separate from all my experiments on here so a venv felt like the way to go.
I have my PyGame game loop running in the main.py file, and then I am building out the game object classes in separate files. My plan is to use OOP (something else that I don’t usually work with) and have a main class for Game Objects. This will move things, draw them to the screen, check if things are aligned with the grid, etc… basically, it handles all the things that will apply to every game object. The snake, snake body, apples, and other parts of the game all need to be drawn to the screen, moved around, destroyed, etc… This is all in my main class.
Other classes have been created for the snake and apple. These all inherit from the Game Object class and then build out their own properties and methods from there. For example, the apple needs a method to allow it to respawn, and it needs a property for storing it’s points value once it has been eaten by the snake.
So far I have got the snake head moving around on screen and it is locked to the grid. Tonight I am hoping to work on getting the movement to feel smooth and responsive for the player, and then maybe I can get the snake tail working.
PyGame and the web
From what I managed to find out, there is a library called Pygbag that allows PyGame projects to be assembled into Web Assembly (WASM). I think this is what the Lua LOVE porting process does too, but it looks way easier with Python for some reason. SIDE NOTE: Why don’t people love Lua??? It is a great language that is fairly easy to pick up and has the whole table datatype working for it that lets it be super versatile! Anyways, I am hoping that this library is a simple as people say because I have chosen PyGame and I am not turning back now!
Wish us luck! I’ll update on here soon! 🐍
Back to Homepage 🏡