chore: update readme and add license
This commit is contained in:
parent
ca481ad7c7
commit
02a915b837
2 changed files with 729 additions and 20 deletions
88
README.md
88
README.md
|
|
@ -1,23 +1,71 @@
|
|||
# Tetris in golang
|
||||
# Tetris (Go + Raylib)
|
||||
|
||||
A small, self‑contained Tetris clone written in Go using raylib‑go.
|
||||
It features classic gameplay (movement, rotation, line clearing, scoring),
|
||||
a simple menu and game‑over flow, pixel‑art tiles, and embedded audio — all shipped as a single binary via `go:embed`.
|
||||
|
||||
## Features
|
||||
|
||||
- Classic Tetris gameplay with 7 tetrominoes
|
||||
- Next piece preview and line clearing with scoring
|
||||
- Keyboard controls for movement, rotation, and soft drop
|
||||
- Simple menu and game‑over screens via a tiny state machine
|
||||
- Embedded sprites, icon, SFX, and background music (no external files at runtime)
|
||||
|
||||
## Controls
|
||||
|
||||
- Left / Right: Move piece
|
||||
- Up: Rotate clockwise
|
||||
- Down (hold): Soft drop (faster fall)
|
||||
- Enter: Select in menu, restart from game over
|
||||
- Q: Return to menu from game over
|
||||
|
||||
## Scoring
|
||||
|
||||
Points are awarded per simultaneous line clear using: `score = L^2 * 100`
|
||||
where `L` is the number of lines cleared at once.
|
||||
|
||||
- 1 line → 100
|
||||
- 2 lines → 400
|
||||
- 3 lines → 900
|
||||
- 4 lines → 1600
|
||||
|
||||
## Build and Run
|
||||
|
||||
Prerequisites:
|
||||
- Go (as indicated in `go.mod`)
|
||||
- A working C toolchain (required by raylib‑go). On Linux you may need basic X11/ALSA dev packages.
|
||||
|
||||
### Build
|
||||
|
||||
Using `make`
|
||||
|
||||
```sh
|
||||
make
|
||||
```
|
||||
|
||||
Using go directly:
|
||||
|
||||
```sh
|
||||
go build tetris.go
|
||||
```
|
||||
### Run
|
||||
|
||||
```sh
|
||||
./tetris
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
- `tetris.go`: Program entrypoint; initializes window, renderer, audio, and the state machine.
|
||||
- `assets/`: Embedded resources (sprites, icon, SFX, music) and a compact tile‑font mapping.
|
||||
- `engine/`: Lightweight helpers for audio, graphics, font/tile rendering, timing, and render context.
|
||||
- `game/`: Core gameplay (grid, shapes, collision, scoring) and state handlers for `menu`, `gameplay`, and `gameover`.
|
||||
|
||||
## Roadmap
|
||||
|
||||
- [x] Initial Commit - Project Scaffolding (rendering engine)
|
||||
- [x] 0.1 - Grid
|
||||
- [x] 0.2 - Basic shapes (falling + collision with floor)
|
||||
- [x] 0.3 - Shapes: Lock + spawn
|
||||
- [x] 0.4 - Collision with with blocks in grid
|
||||
- [x] 0.5 - left/right movement
|
||||
- [x] 0.6 - Shapes rotation
|
||||
- [x] 0.7 - Soft Drop
|
||||
- [x] 0.8 - Clear lines
|
||||
- [x] 0.9 - Score
|
||||
- [x] 0.10 - Next shape
|
||||
- [x] 0.11 - RNG Shape generation
|
||||
- [x] 0.12 - Sound
|
||||
- [x] 0.13 - State machine: Menu, Gameplay and Game Over screen.
|
||||
- [ ] 1.0 - Bugfixes
|
||||
|
||||
## Future things (aka Rad stuffs!)
|
||||
|
||||
- [ ] Animations (Clear lines)
|
||||
- [ ] Line clear animations
|
||||
- [ ] Hard drop and ghost piece
|
||||
- [ ] Level/speed progression and pause
|
||||
- [ ] High score persistence
|
||||
- [ ] Custom key bindings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue