All examples can be run with the following command, where {{name}}
is the name of the example, and {{backend}}
is your graphics backend (usually metal
on MacOS and vulkan
on everything else.) Note that some examples require the additional gltf
feature.
cargo run --example {{name}} --features "{{backend}}"
- Basic
- Rendering
- Assets
- UI
- Debugging
- Networking
- Miscellaneous
- Games
Basic state machine in Amethyst. Prints the following:
Begin!
Hello from Amethyst!
End!
Opens a window and creates a render context. Additionally, shows basic raw input handling.
Uses GameData
, with three different states: Loading
, Main
, Paused
.
Sends and recieves the events A, B, C
.
Game state with a dispatcher. This is useful when only certain systems need to be registered per state.
Renders a basic sphere.
Displays colored spotlights on a plane.
Draws sprites ordered by Z coordinate. Entities with larger Z coordinates will have their sprites drawn in front of entities with smaller Z coordinates.
This example also demonstrates the use of the Transparent
component, the depth buffer, and
camera depth values.
Keybindings:
T
- Toggle whether theTransparent
component is attached to entities.R
- Reverse the Z coordinates of the entities.Up
- Increase the Z coordinate of the camera.Down
- Decrease the Z coordinate of the camera.Right
- Increase the depth (Z distance) that the camera can see.Left
- Decrease the depth (Z distance) that the camera can see.
Loads graphics objects from disk using the asset loader. Contains a custom system that moves the camera and scene.
Showcases the different capabilities of Amethyst's rendy renderer.
Showcases the using a custom shader, pipeline, and renderer to display triangles.
Input:
- `Mouse Wheel' - Changes the scaling of the triangle.
Loads a custom asset using a custom format.
Creates a custom format and loads it using the asset loader.
Renders a sphere using a physically based material.
Animates a sphere using a custom-built animation sampler sequence. Keybindings:
Space
- start/pause/unpause the currentanimation(default is translational animation)D
- demonstrate deferred start, translate will run first, then rotate when translate ends, and last scale animation will start after rotation has run for 0.66s.T
- set translate to current animationR
- set rotate to current animationS
- set scale to current animationH
- run animation at half speedF
- run animation at full speedV
- run animation at no speed, use stepping keys for controlling the animationRight
- step to the next animation keyframeLeft
- step to the previous animation keyframe
Loads a GLTF asset, attaches it to an entity, and animates the asset. Press Space
to start/pause the animation.
Creates a PrefabData
using the adapter pattern.
Creates a trivial PrefabData
and instantiates an entity using the Prefab
system.
Creates a PrefabData
and instantiates an entity with multiple components using the Prefab
system.
Create a PrefabData
and instantiates multiple entities with different components using the Prefab
system.
Renders a basic UI.
Renders a custom UI.
Renders debug lines with a 3D perspective.
Renders debug lines with a 2D orthographic perspective.
Client application using laminar.
Server application using laminar.
Shows the Fly Camera. Captures and releases mouse input.
Shows the Arc Ball Camera.
Adjusts FOV based on render resolution.
Camera follows an entity with sprites.
Shows basic localization for strings used in a game. Prints the following:
Hello, world!
See you later!
Bonjour!
Au revoir!
Showcases the amethyst_tiles
crate.
Amethyst
based Pong clone. In addition to using most of the features used by the other examples, it also demonstrates:
- Input handling using
InputHandler
- Background music and sound effects
- A more interesting UI example
- A larger, multi-file project