Skip to content

Commit

Permalink
feat: release version 0.2.0 (#71)
Browse files Browse the repository at this point in the history
Closes #70, closes #69
  • Loading branch information
90degs2infty committed Jan 5, 2024
2 parents 31eff97 + c001119 commit feeeab8
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/general.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
target_dir: debug
- profile: release
target_dir: release
env:
DEFMT_LOG: info
RUST_LOG: info
steps:
- uses: actions/checkout@v3
- uses: dtolnay/rust-toolchain@v1
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
authors = ["90degs2infty <[email protected]>"]
name = "microtile-app"
edition = "2021"
version = "0.1.0"
version = "0.2.0"
license = "MIT OR Apache-2.0"
repository = "https://github.com/90degs2infty/microtile-app"
categories = [ "embedded", "games", "no-std" ]
Expand Down
39 changes: 18 additions & 21 deletions src/game/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@ use core::{
};
use either::Either;
use micromath::F32Ext;
use microtile_engine::{
gameplay::game::{Game, Observer, ProcessRows, TileFloating, TileNeeded},
geometry::tile::BasicTile,
};
use microtile_engine::gameplay::game::{Game, Observer, ProcessRows, TileFloating, TileNeeded};
use rtic_sync::channel::{ReceiveError, Receiver};

pub enum DriverError {
Expand Down Expand Up @@ -48,7 +45,7 @@ where
game.set_observer(o)
.expect("newly initialized game should not have observer set");
let game = game
.place_tile(BasicTile::Diagonal)
.place_tile(p.generate_tile())
.expect_left("first tile should not end game");
State::TileFloating(game, p)
}
Expand Down Expand Up @@ -133,22 +130,6 @@ where
const COLUMN_2_THRESHOLD: f32 = Self::COLUMN_2_THRESHOLD_UNCOMP - FRAC_PI_2;
const COLUMN_3_THRESHOLD: f32 = Self::COLUMN_3_THRESHOLD_UNCOMP - FRAC_PI_2;

/// Note: the contained peripherals start generating events right away, so be sure to
/// set up the event handling as fast as possible
pub fn new(mailbox: Receiver<'a, Message, MAILBOX_CAPACITY>, o: O, producer: P) -> Self {
// initialize the game
let mut game = Game::default()
.place_tile(BasicTile::Diagonal)
.expect_left("the first tile should not end the game");
game.set_observer(o)
.expect("newly initialized game should not have observer set");

Self {
s: Some(State::TileFloating(game, producer)),
mailbox,
}
}

fn convert_accel_to_column(x: i16, z: i16) -> u8 {
let x: f32 = x.into();
let z: f32 = z.into();
Expand Down Expand Up @@ -189,6 +170,22 @@ where
O: Observer + Debug,
P: TileProducer,
{
/// Note: the contained peripherals start generating events right away, so be sure to
/// set up the event handling as fast as possible
pub fn new(mailbox: Receiver<'a, Message, MAILBOX_CAPACITY>, o: O, mut producer: P) -> Self {
// initialize the game
let mut game = Game::default()
.place_tile(producer.generate_tile())
.expect_left("the first tile should not end the game");
game.set_observer(o)
.expect("newly initialized game should not have observer set");

Self {
s: Some(State::TileFloating(game, producer)),
mailbox,
}
}

pub async fn run(&mut self) -> Result<(), DriverError> {
loop {
let msg = self.mailbox.recv().await.map_err(|e| match e {
Expand Down

0 comments on commit feeeab8

Please sign in to comment.