Crapper is a lightweight, crappy 2D game engine written in Go, leveraging Ebiten for rendering. Its goal is to provide essential game development functionality while maintaining a clean, modular architecture for building cross-platform 2D games.
- Entity-Component System: Flexible object composition
- Physics: Collision detection and resolution
- Path Finding: A* and Dijkstra's algorithms
- Vector Math: Comprehensive 2D vector operations
- Event System: Decoupled communication between systems
- Animation: Sprites, spritesheets and animations
- Resource Management: Efficient asset loading and caching
- Input Handling: Keyboard, mouse, and gamepad support
- Scene Management: Organize game objects and logic
- Implement vector math operations and utilities
- Set up basic project structure
- Main game object
- Create and manage scenes
- Transition between scenes
- Entity creator template
- Camera
- Heuristic functions
- Develop node and priority queue systems for path finding
- Implement A* algorithm
- Implement Dijkstra's algorithm
- Collision detection
- Position
- Velocity
- Acceleration
- Size
- Sprite
- AnimatedSprite
- UserInput
- MouseClickFollow
- Health
- Collision
- Targeting
Split by responsibility, not by mechanism.
- Interface
- Movement
- Acceleration
- Velocity
- MouseClickFollow
- Debug
- Rendering
- Sprite
- AnimatedSprites
- HealthBar
- UserInput
- Health
- TargetAcquisition
- Multi layer
- SpriteManager
- SpriteSheetManager
package main
import (
"github.com/seppedelanghe/crapper/pkg/engine/core"
)
func main() {
gameOpts := game.GameOptions{
Width: 640,
Height: 480,
Vsync: true,
WindowResize: false,
}
game := core.NewGame()
// Configure your game...
if err := game.Run(); err != nil {
panic(err)
}
}