https://github.com/schell/old-gods
Old Gods Engine
https://github.com/schell/old-gods
Last synced: 8 months ago
JSON representation
Old Gods Engine
- Host: GitHub
- URL: https://github.com/schell/old-gods
- Owner: schell
- Created: 2019-12-13T01:05:42.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-11-27T17:56:00.000Z (over 5 years ago)
- Last Synced: 2025-04-01T22:38:40.937Z (11 months ago)
- Language: Rust
- Size: 10.1 MB
- Stars: 20
- Watchers: 5
- Forks: 1
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
The Old Gods Engine
This is an aspirational handmade game engine meant for games targeting the web and SDL2.
It reads Tiled map files into a specs based entity component system.
Rendering is handled by HtmlCanvasElement or the built in SDL2 renderer.
A number of base systems handle the core of the engine:
* TiledmapSystem - loads maps
* Physics - collision detection and handling
* AnimationSystem - sprite animation
* GamepadSystem - controller support
More specific add-ons are available as separate crates.
## Warning
This is a WIP and it was also my first Rust project.
## Performance
I'm really surprised at the performance. So far without any attention to
performance the engine is running at about 330FPS, with a high of about 500FPS
(in SDL2). On wasm it's running at a pretty steady 60FPS, but this is only
because the frame rate is tied to `requestAnimationFrame`.
## Core Features
* Map creation using the ubiquitous Tiled map editor.
* Animation
* Sprites (nested, keyframed Tiled maps)
* Collision detection and handling (SAT for AABBs)
* Dynamic viewport rendering
* Easily overridable default rendering
See the [old gods architectural diagram](old_gods/architecture.md) for a quick
overview of the core systems.
## Extras / Examples
* Inventory and items
## Building
First you'll need new(ish) version of the rust toolchain. For that you can visit
https://rustup.rs/ and follow the installation instructions.
This project uses the nightly release:
```
rustup default nightly
```
Then you'll need [wasm-pack](https://rustwasm.github.io/wasm-pack/installer/).
Then, if you don't already have it, `cargo install basic-http-server` or use your
favorite alternative static web server to serve assets.
After that building is pretty straightforward
```
cargo build
wasm-pack build --debug --target web examples/{some example}
basic-http-server -x -a 127.0.0.1:8888 examples/{some example}
```
Then visit http://localhost:8888/
## Contributing
If you'd like to contribute check the [issues][issues]. Or look at what
[projects][projects] are kicking around!
### Code style
Formatting is enforced by `rustfmt`. Before you commit do:
```
cargo fmt
```
and your changes will be reformatted to fit our standard.
[issues]: https://github.com/schell/old-gods/issues
[projects]: https://github.com/schell/old-gods/projects