Skip to content

ezeoleaf/termagotchi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

7 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Termagotchi ๐Ÿพ

A terminal-based Tamagotchi simulation written in Go, featuring a beautiful TUI interface.

Features

  • ๐ŸŽฎ Interactive TUI: Beautiful terminal user interface with keyboard navigation
  • ๐Ÿพ Digital Pet Care: Feed, play, and put your tamagotchi to sleep
  • ๐Ÿ“Š Real-time Stats: Monitor hunger, happiness, health, and energy levels
  • ๐Ÿ”„ Life Stages: Watch your tamagotchi evolve from egg to adult
  • ๐Ÿ“ Event History: Track all interactions and milestones
  • ๐Ÿ’พ Auto-save: Progress is automatically saved to your config directory
  • โฐ Time-based Mechanics: Stats change over time, requiring regular care
  • ๐Ÿ”„ Restart Feature: Reset to a new tamagotchi with confirmation modal

Installation

Homebrew (recommended, after release)

brew tap ezeoleaf/tap
brew install termagotchi

Download a Release

  • Go to Releases and download the binary for your OS.
  • Unpack and move it to a directory in your $PATH (e.g., /usr/local/bin).

Build from Source

Prerequisites

  • Go 1.24.0 or later
git clone <repository-url>
cd termagotchi
go mod tidy
go build -o termagotchi cmd/termagotchi/main.go
./termagotchi

Usage

Controls

  • Ctrl+S: Status - View tamagotchi stats
  • Ctrl+F: Feed - Give food to tamagotchi
  • Ctrl+P: Play - Play games with tamagotchi
  • Ctrl+L: Sleep - Put tamagotchi to sleep
  • Ctrl+E: Events - View game history
  • Ctrl+H: Help - Show help page
  • Ctrl+R: Restart - Reset tamagotchi to new egg
  • Ctrl+C: Quit - Exit the game

Navigation

  • Use arrow keys to navigate lists
  • Press Enter to select items
  • Use Ctrl+key shortcuts for quick access

Game Mechanics

Stats

  • Hunger: 0 = Full, 100 = Starving
  • Happiness: 0 = Very Sad, 100 = Very Happy
  • Health: 0 = Sick, 100 = Healthy
  • Energy: 0 = Tired, 100 = Energetic

Life Stages

  1. Egg (0-1 days)
  2. Baby (1-3 days)
  3. Child (3-7 days)
  4. Teen (7-14 days)
  5. Adult (14+ days)

Food Types

  • ๐ŸŽ Apple: Good nutrition, low weight gain
  • ๐Ÿ• Pizza: High nutrition and happiness
  • ๐Ÿฅ— Salad: Healthy option
  • ๐Ÿ” Burger: High nutrition but heavy
  • ๐Ÿฆ Ice Cream: High happiness boost
  • ๐Ÿฅ• Carrot: Balanced nutrition
  • ๐Ÿซ Chocolate: Happiness boost
  • ๐Ÿฅฉ Steak: Maximum nutrition

Games

  • ๐ŸŽพ Play Ball: Classic fun
  • ๐Ÿƒโ€โ™‚๏ธ Run Around: Good exercise
  • ๐ŸŽต Sing Songs: Low energy, high happiness
  • ๐ŸŽจ Draw Pictures: Creative fun
  • ๐Ÿงฉ Solve Puzzle: Mental stimulation
  • ๐ŸŽญ Dance Party: High energy fun
  • ๐Ÿ“š Read Books: Educational
  • ๐ŸŽช Play Hide & Seek: Interactive fun

Sleep Options

  • ๐Ÿ˜ด Short Nap (30 min): Quick energy boost
  • ๐Ÿ˜ช Medium Sleep (2 hours): Balanced rest
  • ๐Ÿ˜ด Long Sleep (6 hours): Good recovery
  • ๐Ÿ˜ด Full Night (8 hours): Complete restoration

Tips for Success

  1. Feed Regularly: Keep hunger below 80 to maintain happiness
  2. Play Often: Increase happiness and health through games
  3. Rest When Needed: Put to sleep when energy is low
  4. Monitor Health: Low health can lead to death
  5. Balance Stats: Keep all stats in good ranges
  6. Restart When Needed: Use Ctrl+R to start fresh if your tamagotchi dies

Configuration

The game automatically saves your progress to:

  • macOS: ~/Library/Application Support/termagotchi/config.yml
  • Linux: ~/.config/termagotchi/config.yml
  • Windows: %APPDATA%\termagotchi\config.yml

Development

Project Structure

termagotchi/
โ”œโ”€โ”€ cmd/
โ”‚   โ””โ”€โ”€ termagotchi/
โ”‚       โ””โ”€โ”€ main.go
โ”œโ”€โ”€ internal/
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ”œโ”€โ”€ app.go
โ”‚   โ”‚   โ”œโ”€โ”€ structs.go
โ”‚   โ”‚   โ”œโ”€โ”€ pages.go
โ”‚   โ”‚   โ”œโ”€โ”€ status.go
โ”‚   โ”‚   โ”œโ”€โ”€ feed.go
โ”‚   โ”‚   โ”œโ”€โ”€ play.go
โ”‚   โ”‚   โ”œโ”€โ”€ sleep.go
โ”‚   โ”‚   โ”œโ”€โ”€ events.go
โ”‚   โ”‚   โ””โ”€โ”€ help.go
โ”‚   โ””โ”€โ”€ config/
โ”‚       โ””โ”€โ”€ config.go
โ”œโ”€โ”€ go.mod
โ”œโ”€โ”€ go.sum
โ””โ”€โ”€ README.md

Dependencies

  • github.com/gdamore/tcell/v2: Terminal UI framework
  • github.com/rivo/tview: TUI components
  • gopkg.in/yaml.v3: Configuration file handling

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Acknowledgments

  • Inspired by the classic Tamagotchi digital pet
  • Built with the amazing tview TUI framework
  • Thanks to the Go community for excellent libraries

About

Your terminal tamagotchi ๐Ÿ‘พ

Resources

License

Stars

Watchers

Forks

Packages

No packages published