A terminal-based snake game with Portal-style teleportation mechanics. Navigate your rainbow snake through portals that you place with mouse gestures!
- Auto-moving snake with dynamic rainbow colors flowing along its body
- Mouse-controlled portal placement with drag gestures
- Bidirectional portals - enter either color, exit from the other
- Animated spinning pellets
- Classic snake gameplay with a portal twist
- Left-click and drag: Place blue portal
- Drag direction sets portal exit direction (up/down/left/right)
- Right-click and drag: Place red portal
- Drag direction sets portal exit direction
- P: Pause/unpause game
- C: Clear all portals
- Q or ESC: Quit game
- Your snake moves automatically in a straight line
- Place portals by clicking and dragging in the direction you want the snake to exit
- When the snake enters one portal, it exits from the other portal in the direction you specified
- Eat pellets to grow your snake and increase your score
- Avoid hitting walls or yourself!
- Plan your portal placements ahead of time
- Remember: you can only have one red and one blue portal at a time
- Placing a new portal of the same color replaces the old one
- Use portals to navigate tight spaces and avoid collisions
- The snake exits portals in the direction you dragged when placing them
- Go 1.21 or higher
- Terminal with mouse support (most modern terminals)
cd ~/dev/PortalSnake
go build -o portalsnake./portalsnakeBuilt with a component-based architecture using Go channels:
- GameCoordinator: Central game state management
- SnakeEngine: Snake movement and collision detection
- PortalManager: Portal placement and teleportation logic
- PelletSpawner: Random pellet generation
- AnimationEngine: Rainbow and spinning effects (50ms tick)
- Renderer: Terminal rendering with tcell
- InputHandler: Mouse and keyboard input processing
Each component runs in its own goroutine, communicating via channels.
- tcell v2 - Terminal UI and mouse input
MIT License - Feel free to use and modify!