MCPcopy Index your code
hub / github.com/SergiusIW/gate

github.com/SergiusIW/gate @v0.6.3

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.6.3 ↗ · + Follow
268 symbols 507 edges 39 files 64 documented · 24%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Gate

Gate is a game development library tailored to 2D pixel-art games, written in Rust.

Games

I've made a couple of games using Gate, which are playable through a web-browser thanks to Gate's WebAssembly support.

Crate

The Rust crate for Gate can be found here, and the crate for Gate Build can be found here

Documentation

Documentation for Gate can be found here, and for Gate Build here

Description

When creating a game, it is good practice to make a layer, specific to one's needs, that separates the game logic from the resource management, rendering, audio, and other interfacing that is needed for a game. "Gate" is the layer that I created for this purpose with my personal game development endeavors, and I decided to make it public. It should be noted that this library was developed for my own personal needs, and is not meant to be a general purpose game development library. This manifests itself mostly with the renderer, which is made specifically for 2D pixel art. If your game has similar needs or you just want to get something going quickly, then this library is for you. If you have slightly different needs, then you can still use this code as a reference point.

Users of this crate should create a build script in their project, invoking functionality from the sibling crate "gate_build". This will generate texture atlases and enums to reference assets. See the "gate_build" crate for more details.

Example

For a full example, see https://github.com/SergiusIW/gate/tree/master/example.

License

Collider is licensed under the Apache 2.0 License.

Future changes

There are a number of new features I am planning to add to Gate in the future. Some of these will involve breaking changes.

  • Loading assets on the fly
  • Support for displaying text
  • Adding XBox controller input
  • Generating enums/handles for user-specific assets, and loading those assets
  • Handling game save data
  • Playing looping music that has a one-time intro, without any hiccups in the music (not sure how I'm going to do this, but it's important to me; game libraries often seem to overlook this fundamental feature)
  • New renderer modes with new shaders

Extension points exported contracts — how you extend this code

App (Interface)
Trait that a user can implement to specify application behavior, passed into `gate::run(...)`. [1 implementers]
gate/src/lib.rs
AppAssetId (Interface)
A convenience collection of all asset ID types. [1 implementers]
gate/src/asset_id.rs
IdU16 (Interface)
Traits related to asset enums that are generated by "gate_build". The user is not expected to implement these traits th
gate/src/asset_id.rs
TraitAppRunner (Interface)
(no doc) [1 implementers]
gate/src/core/wasm/mod.rs

Core symbols most depended-on inside this repo

len
called by 16
gate/src/renderer/geom.rs
gateFail
called by 14
gate_build/src/html/gate.js
app_runner_borrow_mut
called by 9
gate/src/core/wasm/mod.rs
rerun_print
called by 7
gate_build/src/lib.rs
add_sprite_vertex
called by 6
gate/src/renderer/vbo_packer.rs
height
called by 6
gate_build/src/rect_packer/mod.rs
width
called by 6
gate_build/src/rect_packer/mod.rs
key_up
called by 4
gate/src/lib.rs

Shape

Method 151
Function 80
Class 31
Interface 4
Enum 2

Languages

Rust90%
TypeScript10%

Modules by API surface

gate/src/renderer/geom.rs29 symbols
gate_build/src/html/gate.js26 symbols
gate/src/app_context.rs25 symbols
gate/src/core/wasm/mod.rs23 symbols
gate_build/src/asset_packer.rs15 symbols
gate_build/src/rect_packer/mod.rs13 symbols
gate/src/renderer/renderer.rs13 symbols
gate/src/core/wasm/wasm_exports.rs12 symbols
gate_build/src/atlas.rs10 symbols
example/src/main.rs10 symbols
gate/src/renderer/render_buffer.rs9 symbols
gate/src/core/sdl/mod.rs9 symbols

For agents

$ claude mcp add gate \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact