- Interactive: For humans.
- Non-interactive: For computers.
- Print informatives to
stderr.
I hereby claim:
To claim this, I am signing this object:
| use std::ptr; | |
| use amethyst::renderer::{ | |
| loaders::load_from_srgba, | |
| palette::Srgba, | |
| rendy::{ | |
| hal::image::{Filter, Kind, SamplerInfo, ViewKind, WrapMode}, | |
| texture::{pixel::Rgba8Srgb, TextureBuilder}, | |
| }, | |
| types::TextureData, |
| // Put this somewhere | |
| #[derive(Debug)] | |
| struct WaitForLoad; | |
| impl<T, E> State<T, E> for WaitForLoad | |
| where | |
| T: GameUpdate, | |
| E: Send + Sync + 'static, | |
| { | |
| fn update(&mut self, data: StateData<'_, T>) -> Trans<T, E> { | |
| data.data.update(&data.world); |
This post covers how game object behaviour and animations are done in [Will].
Disclaimer:
My professional experience has been in enterprise software, system administration, and automation. Anything in this blog post is largely personal development experience, and may differ from recommendations from game development studios.
Will is built on the [Amethyst] game engine, which uses the [specs] ECS library. This post assumes existing understanding of the difference between an object-oriented data layout (hierarchical), and the ECS data layout (relational).
| use amethyst::ecs::{storage::DenseVecStorage, Component}; | |
| use derive_new::new; | |
| use serde::{Deserialize, Serialize}; | |
| use specs_derive::Component; | |
| /// Logical clock that has a value and limit. | |
| #[derive( | |
| Clone, Component, Copy, Debug, Default, Deserialize, Hash, PartialEq, Eq, Serialize, new, | |
| )] | |
| pub struct LogicClock { |
Need to install capnproto: https://capnproto.org/install.html
Download the Zip file from the page.
Extract to somewhere such as D:\apps.
Add D:\apps\capnproto-tools-win32-0.7.0 to your PATH.
I added it to the system PATH because it's used by my CI.
| use std::{collections::HashMap, fmt::Debug, mem, path::PathBuf}; | |
| use amethyst::{ | |
| assets::{AssetStorage, Handle, Loader, Prefab, PrefabLoader, ProgressCounter}, | |
| ecs::{Read, ReadExpect, System, Write}, | |
| renderer::{SpriteSheet, Texture}, | |
| }; | |
| use asset_loading::{AssetDiscovery, TomlFormat}; | |
| use asset_model::config::{AssetIndex, AssetRecord}; | |
| use derivative::Derivative; |
| use std::{marker::PhantomData, ops::Deref, sync::Arc}; | |
| use amethyst::{ | |
| assets::{AssetStorage, HotReloadStrategy, Loader, ProcessingState}, | |
| core::Time, | |
| ecs::{Read, ReadExpect, System, Write}, | |
| }; | |
| use collision_model::config::{Body, Interactions}; | |
| use derivative::Derivative; | |
| use derive_new::new; |