wasm4 v0.0.3
This is the first working release of wasm4
crate! You can add this crate
as a dependency to your cartridge's code by specifying it in Cargo.toml:
[dependencies]
wasm4 = "0.0.3" # add this line
Fully safe statefull cartridges
You can now create fully safe statefull cartridges like this:
// src/main.rs
#![no_main]
struct MyRuntime {
count: i32,
}
// prints "tick..." every second
impl wasm4::Runtime for MyRuntime {
fn start(_: wasm4::Resources) -> Self {
MyRuntime { count: 0 }
}
fn update(&mut self) {
if self.count % 60 == 0 {
wasm4::trace("tick");
self.count = 0;
}
self.count += 1;
}
}
wasm4::main! { MyRuntime }
Notice that this is not a library (src/lib.rs
), but an executable (src/main.rs
). This is done for better integration with cargo tooling, being able to run these cartriges using cargo run
.
Bug Fixes
- copy example's source into wasm4 docs
Documentation
- add changelog for
wasm4
New Features
- add runtime creation functionality
refactor (BREAKING)
- change to the new experimental api
Commit Statistics
- 14 commits contributed to the release over the course of 18 calendar days.
- 6 commits where understood as conventional.
- 0 issues like '(#ID)' where seen in commit messages
Commit Details
view details
- Uncategorized
- regenerate and adjust docs (fc71325)
- copy example's source into wasm4 docs (74390f2)
- Release wasm4-sys v0.1.0, wasm4 v0.0.3 (9a8c498)
- regenerate and adjust changelog (ceaee04)
- bump crates versions (2c68e02)
- add runtime creation functionality (7a1d011)
sound::Mode
values are bit aligned forsound::Flags
(8027ce0)- change to the new experimental api (233c4f9)
- add changelog for
wasm4
(7b490fe) - Release 0.0.2 (d7fbc7c)
- Release 0.0.1 (0090ea9)
- Prepare manifest for publish (3b31a1e)
- Fix docs a bit (cbe67e0)
- Implement sys bindings; Implement sound module (babbc6d)