Skip to content

About

This is a snake game made for mobile devices

Resources

Stars

4 stars

Watchers

1 watching

Forks

Latest commit

 

History

21 Commits

Folders and files

Repository files navigation

Star Snake Game

Star Snake Game is a Unity mobile snake game. The deployed gameplay uses the continuous touch/cursor-driven snake flow in Scene_Play.

Unity Version

  • Unity 6000.3.9f1
  • Build scenes are configured in this order:
    • Assets/Scenes/Scene_Load.unity
    • Assets/Scenes/Scene_Menu.unity
    • Assets/Scenes/Scene_Play.unity

Runtime Flow

  • Manager_Main owns scene navigation and resets Time.timeScale when loading scenes.
  • Manager_Menu handles menu buttons, PlayFab login, and high-score display.
  • Manager_Play owns score, restart, pause, game over, food spawning, and high-score submission.
  • Object_Snake, Object_SnakeBody, Object_Food, Object_Wall, and InputArea form the active gameplay loop.

SnakeBehaviour and FeedingMechanism are currently not referenced by the tracked scenes or prefabs. Treat them as experimental legacy scripts unless they are wired into a future scene intentionally.

Production Fixes Applied

  • High-score submission now checks the existing PlayFab HighScore statistic before uploading, so a lower score is not submitted as the new high score from the client path.
  • Restart clears active food and bonus food before rebuilding the snake, preventing old scene objects from leaking into the next run.
  • Game over is guarded against duplicate calls and stops snake audio consistently.
  • Food spawning samples within configured spawn limits and rejects positions near existing 2D colliders, reducing spawns on the snake, walls, or other food.
  • Input state is reset when the input area disables, which prevents stale touch/mouse state across scene transitions.
  • Scene navigation uses named constants for the configured scene indexes.

Git Hygiene

Unity-generated folders are ignored in .gitignore, including Library/, Logs/, Temp/, UserSettings/, build output, IDE caches, generated solution files, and Unity recovery scenes.

If generated files are already tracked, remove them from the index without deleting local files:

git rm -r --cached Library Logs UserSettings
git rm --cached .vscode/settings.json

Then review the remaining status before committing.

Unity Follow-Up

After opening Unity, verify these Inspector settings:

  • Manager_Play still has Trans_Items, Pannel_GameOver, Point_Origin, m_Snake, SpawnLimits, Prefabe_Food, Prefabe_BonusFood, and Text_Score assigned.
  • spawnClearRadius on Manager_Play is suitable for the board size and collider sizes.
  • PlayFab title settings still point to title ID 11C0BD.
  • The PlayFab HighScore statistic should also be configured server-side to aggregate by maximum value where possible.

About

This is a snake game made for mobile devices

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages