Skip to content

hvtims/makeyourgame-score

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

makeyourgame-score

Space Invaders-style browser game with a small Go backend that serves the frontend and stores leaderboard scores in SQLite.

Features

  • Classic Space Invaders gameplay with lives, levels, and score tracking.
  • Leaderboard showing the top 10 scores.
  • Keyboard and touch controls.
  • Pause menu, restart, and game over screen.

Tech stack

  • Go 1.22+ with net/http and sqlite3 (github.com/mattn/go-sqlite3).
  • Vanilla HTML/CSS/JS frontend.
  • SQLite database at database.db, schema in shema.sql.

Quick start

  1. Install Go 1.22+ and a C compiler (required for sqlite3 CGO builds).
  2. Run the server:
    go run .
  3. Open http://localhost:8080/ in your browser.

Controls

  • Left/Right Arrow: move the ship.
  • Space: shoot.
  • Esc: pause/resume.
  • Touch: drag on the game board to move; tap to shoot.

API

  • POST /score
    • Body: {"username":"player","score":123}
    • Stores the score in SQLite.
  • GET /sendscores
    • Returns a JSON array of {username, score}.

Project structure

  • main.go: Go web server, routes, and DB initialization.
  • index.html, style.css, script.js: frontend entry points.
  • modules/: game logic, UI, and leaderboard rendering.
  • database.db: SQLite database file (auto-created/updated at startup).
  • shema.sql: database schema for the users table.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors