MCPcopy Index your code
hub / github.com/AndriBaal/shura

github.com/AndriBaal/shura @0.6.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.6.0 ↗ · + Follow
938 symbols 1,931 edges 73 files 90 documented · 10% updated 22mo ago0.6.0 · 2023-06-21★ 74
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

shura

shura is a safe, fast and cross-platform 2D component-based game framework written in rust. shura helps you to manage big games with it's scene managing, group system and component system which is designed to easily share components between projects (therefore allowing for a ecosystem of components). shura has everything your 2D game needs such as physics, controller input, audio, easy extensible rendering, serializing, deserializing, text rendering, gui, animations and many more. See the features section for all of shura's features.

shura is currently in an early version and things might change in the future or don't work as intended. Feel free to create an issue if you encounter bugs, have feedback or have questions.

Getting started

To see some examples head to the /examples directory or run cargo run --release --example bunnymark

Get started by copying the template. The template includes the library, some introduction and has some additional configuration to make sure your game runs on all supported platforms.

OR:

Add the following to your Cargo.toml:

[dependencies]
shura = "0.3.0"

A good way to learn shura is through the provided examples or through reading the code documentation.

Features

  • Managing multiple independent scenes.

  • Easy to use component system with a group system to ensure fast manageable 2D games in massive levels

  • Group system that acts like a chunk system to organize components and manage big worlds

  • Support for postprocessing of your renders

  • Easy to configure camera scaling, to ensure your game is responsive and works on all sort of screens

  • Physics simulations directly implemented into the component system through rapier (feature flag 'physics')

  • Window Management with winit

  • Cross-platform extendable rendering with wgpu

  • Input handling for touch, mouse and keyboard and controller with gilrs (feature flag 'gamepad')

  • Text rendering inspired by wgpu_text (feature flag 'text')

  • Audio playback with rodio (feature flag 'audio')

  • Easily create GUI's with egui (feature flag 'gui')

  • Serializing and serializing of scenes and groups with serde and bincode

  • Animations inspired by bevy_tweening (feature flag 'animation')

  • Logging on all Platforms with env_logger and a modified verison of wasm_logger (feature flag 'log')

Cross-platform

shura is currently only tested on Windows 10 / 11, Linux, Android and on the web with WASM. macOS and iOS are currently untested, but are likely to work.

The template uses run-wasm to run on the web and cargo-apk to run on android.

Android

When compiling for android make sure the following is added in the Cargo.toml:

[lib]
crate-type = ["cdylib"]
path = "src/main.rs"

Extension points exported contracts — how you extend this code

ComponentController (Interface)
A controller is used to define the behaviour of a component, by the given config and callbacks. [17 implementers]
src/component/component_derive.rs
SceneCreator (Interface)
Origin of a [Scene] [3 implementers]
src/scene/scene.rs
Stepable (Interface)
(no doc) [4 implementers]
src/tween/tween.rs
StateIdentifier (Interface)
Trait to identify a struct that derives from the [State](crate::State) macro using a [StateTypeId]
src/state/state.rs
BaseComponent (Interface)
Base of every component. Provides a method to generate a 2D Matrix, so the component can be rendered to the screen. [4 …
src/component/component_derive.rs
Tweenable (Interface)
(no doc) [2 implementers]
src/tween/tween.rs
StateDerive (Interface)
(no doc)
src/state/state.rs
ComponentDerive (Interface)
All components need to implement from this trait. This is not done manually, but with the derive macro [Component](crate [1 …
src/component/component_derive.rs

Core symbols most depended-on inside this repo

into
called by 53
src/graphics/color.rs
add
called by 33
src/scene/scene_manager.rs
insert
called by 32
src/data/arena.rs
iter
called by 32
src/data/arena.rs
create_model
called by 30
src/graphics/gpu.rs
translation
called by 27
src/graphics/camera.rs
clamp
called by 27
src/tween/ease.rs
component_index
called by 24
src/component/component_handle.rs

Shape

Method 764
Class 118
Enum 28
Function 17
Interface 11

Languages

Rust100%

Modules by API surface

src/component/component_manager.rs86 symbols
src/component/component_type.rs50 symbols
src/graphics/model.rs46 symbols
src/input/input.rs44 symbols
src/world/world.rs43 symbols
src/tween/tween.rs43 symbols
src/graphics/camera.rs40 symbols
src/data/arena.rs40 symbols
src/component/component_set.rs40 symbols
src/tween/ease.rs38 symbols
src/graphics/gpu.rs30 symbols
src/graphics/renderer.rs25 symbols

For agents

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

⬇ download graph artifact

Ask about this repo answers extend the page