DevLog_0: Game Concept
Snek
Description
Snek is my take on the classic mobile game "Snake." It follows the original gameplay: eat food to grow and increase your score, while avoiding walls and your own tail. As the snake grows, it also moves faster (up to a limit), adding an extra challenge.
Game Purpose
This project is designed to explore mobile touch controls and various screen aspect ratios in a WebGL format. Testing has been done on a PC browser, iPhone, iPad, and Android phone. Originally, I planned to use Unity’s new Input System for touch controls, but encountered issues detailed below..
Challenges and Solutions
Initially, I implemented swipe controls with Unity's new Input System, but WebGL compatibility problems emerged. Other developers have reported similar issues with Unity’s touch controls on WebGL, possibly due to platform limitations outside Unity's control. To work around this, I replaced swipe touch controls with a mouse click-and-drag emulation. This approach not only allows for easier PC testing but also functions similarly to touch on mobile devices.
Future Improvements
While testing, I found that my drag-and-swipe method could be refined. Currently, the program waits until the user lifts their finger to determine swipe direction. This can lead to a slight delay in directional response, as the length and duration of the touch affect the outcome. To improve this, I plan to calculate directional changes continuously based on the finger's position relative to the starting point, rather than waiting for the touch to end. This adjustment may introduce new challenges, but it's straightforward to implement and worth testing for improved responsiveness.
Another issue is with the button-based control mode (for up, down, left, and right). Currently, these buttons don’t trigger their respective actions until the user lifts their finger, rather than on the initial press. I plan to update this mode to respond immediately to "onButtonDown" actions, bypassing Unity's default button system to provide a more responsive control experience.
Leave a comment
Log in with itch.io to leave a comment.