Crates.io | bevy_match3 |
lib.rs | bevy_match3 |
version | 0.4.0 |
source | src |
created_at | 2022-03-07 16:11:31.033615 |
updated_at | 2024-01-26 18:59:40.929179 |
description | A logic library for quickly adding a match-3 system to any bevy project |
homepage | https://github.com/Sheepyhead/bevy_match3 |
repository | https://github.com/Sheepyhead/bevy_match3 |
max_upload_size | |
id | 545089 |
size | 1,857,650 |
bevy_match3
is a crate for handling the logic side of match 3 games in Bevy.
bevy |
bevy_match3 |
---|---|
0.6 | 0.0.1 |
0.7 | 0.0.2 |
0.8 | 0.1.0 |
0.9 | 0.2.0 |
0.10 | N/A |
0.11 | 0.3.0 |
0.12 | 0.4.0 |
To get started with this crate all you need is to set up the plugin
use bevy_match3::prelude::*;
fn main() {
App::new()
.add_plugins((DefaultPlugins, Match3Plugin))
.run();
}
React to board events
fn consume_events(
mut events: ResMut<BoardEvents>,
) {
if let Ok(event) = events.pop() {
match event {
BoardEvent::Swapped(pos1, pos2) => todo!(),
BoardEvent::FailedSwap(pos1, pos2) => todo!(),
BoardEvent::Popped(pos) => todo!(),
BoardEvent::Matched(matches) => todo!(),
BoardEvent::Dropped(drops) => todo!(),
BoardEvent::Spawned(spawns) => todo!(),
}
}
}
and start sending commands to the board using the BoardCommands
resource!
For now there is one example of all features at basic.rs
All code in this repository is dual-licensed under either:
at your option.