Concept:
For my project I plan on redesigning the classic game “Snake,” however I do plan on adding my own twists to the game.
- In this game the Snake is represented as glowing circular outlines, moving like a light source.
- For the background I intend to add islamic geometric patterns for the aesthetics, but I still haven’t implemented it yet.
- More Features will be added to make the game more engaging and interesting.
UI Design:
Interactions remain the same as the classic game:
- Arrow Keys to control direction
- Mouse click to start/restart game
- T key to toggle theme
I decided to keep interactions simple to preserve the familiarity of the game, in hopes that the visual redesign could shift the experience from purely arcade-based to more atmospheric and reflective. Additionally, there’s a time counter, to make players more aware of the duration rather than just the score.
Code Structure:
I tried making the program more organized by into different layers, where each part does a specific function. They are:
- Game Logic: to handle movement, growth, collision and fruit spawning.
- Rendering: for background, glowing snake, grid display and UI overlay
- Interaction: to handle key input and theme toggling
I made sure to separate things to avoid confusion and to make adding additional features easier.
Uncertain / Complex Parts:
The thing I’m most worried about is adding sounds to the game as there are several different things that need it such as:
- fruit collection
- collision
- background sound
There are several issues I’ve identified which include the timing of the sounds, possible audio restrictions and making sure the audio is not distracting.
To avoid this risk early on, I experimented with basic p5.js sound playback on its own. I tested playing simple oscillator sounds based on mouse interaction to make sure that:
- Audio plays back properly after user interaction.
- There are no console errors.
- Sound playback can be controlled in short bursts.
- Sound playback can synchronize with game events such as fruit pickup.
By testing sound playback independently before incorporating it into the full game logic, I avoided the risk of ruining the main system later on.
