Add CI #1

Merged
msrd0 merged 7 commits from ci into main 2024-07-05 21:57:00 +00:00
4 changed files with 1111 additions and 1930 deletions
Showing only changes of commit 02f6770cd2 - Show all commits

2985
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
[package]
name = "turtlegame"
name = "powercreep"
version = "0.1.0"
publish = false
edition = "2021"
@ -8,9 +8,6 @@ description = "turtlegame - the game from the turtleteam :)"
[workspace]
resolver = "2"
# Enable a small amount of optimization in debug mode
[profile.dev]
# opt-level = 1
# Enable high optimizations for dependencies (incl. Bevy), but not for our code:
@ -18,4 +15,5 @@ resolver = "2"
opt-level = 3
[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() {
App::new()
.add_plugins(DefaultPlugins)
.run();
pollster::block_on(run());
}