Merge remote-tracking branch 'origin/main' into ci
Some checks failed
Rust / rustfmt (pull_request) Failing after 26s
Rust / clippy (pull_request) Successful in 1m14s
Rust / build (pull_request) Failing after 2m49s

This commit is contained in:
Dominic 2024-07-05 23:41:25 +02:00
commit 02f6770cd2
Signed by: msrd0
GPG key ID: AAF7C8430CA3345D
4 changed files with 1111 additions and 1930 deletions

2985
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
[package] [package]
name = "turtlegame" name = "powercreep"
version = "0.1.0" version = "0.1.0"
publish = false publish = false
edition = "2021" edition = "2021"
@ -8,9 +8,6 @@ description = "turtlegame - the game from the turtleteam :)"
[workspace] [workspace]
resolver = "2" resolver = "2"
# Enable a small amount of optimization in debug mode
[profile.dev]
# opt-level = 1 # opt-level = 1
# Enable high optimizations for dependencies (incl. Bevy), but not for our code: # Enable high optimizations for dependencies (incl. Bevy), but not for our code:
@ -18,4 +15,5 @@ resolver = "2"
opt-level = 3 opt-level = 3
[dependencies] [dependencies]
bevy = "0.14.0" comfy = { version = "0.4.0", features = ["wayland"] }
log = "0.4.22"

11
src/game.rs Normal file
View file

@ -0,0 +1,11 @@
use comfy::*;
use crate::State;
pub fn update(_state: &mut State, _engine: &mut EngineContext) {
info!("update");
}
pub fn draw(_state: &State, _engine: &EngineContext) {
draw_circle(vec2(0.0, 0.0), 0.5, RED, 0);
}

View file

@ -1,7 +1,34 @@
use bevy::prelude::*; mod game;
use comfy::*;
const GAME_NAME: &str = "Powercreep";
#[derive(Debug)]
struct State {}
impl GameLoop for State {
fn new(_c: &mut EngineState) -> Self {
State {}
}
fn update(&mut self, engine: &mut EngineContext) {
game::update(self, engine);
game::draw(self, engine);
}
}
fn config(config: GameConfig) -> GameConfig {
config
}
async fn run() {
init_game_config(GAME_NAME.to_string(), env!("CARGO_PKG_VERSION"), config);
let mut engine = EngineState::new();
let game = State::new(&mut engine);
run_comfy_main_async(game, engine).await;
}
fn main() { fn main() {
App::new() pollster::block_on(run());
.add_plugins(DefaultPlugins)
.run();
} }