A game engine
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
lisk77 0c86c6da78
Merge pull request #17 from lisk77/feat/diagnostics
- basic diagnostics features
- saved in jsonl format
- `.comet/diagnostics` home for generated diagnostics
2026-09-05 03:12:59 +02:00
crates refactor(diagnostics): module timestamp output 2026-09-05 03:06:34 +02:00
examples docs(examples): trait query combinators 2026-09-05 00:05:21 +02:00
res refactor(examples): use PublicPixel instead of PressStart2P font 2026-03-14 01:59:08 +01:00
src feat(ecs): modified query filters 2026-09-04 21:25:35 +02:00
.gitignore refactor(diagnostics): module timestamp output 2026-09-05 03:06:34 +02:00
Cargo.toml feat(diagnostics): shared diagnostics infrastructure 2026-09-05 02:58:37 +02:00
goals.md chore: update goals and readme 2026-03-30 12:57:20 +02:00
LICENSE-APACHE chore(license): update project licensing 2026-08-27 20:12:54 +02:00
LICENSE-MIT chore(license): update project licensing 2026-08-27 20:12:54 +02:00
README.md chore(readme): api changes in code example 2026-08-25 17:49:06 +02:00

☄️ Comet

a free and open source game engine

Warning

This project is in early development and is not yet ready for use.

It could be potentially used to make something very basic in a very hacky way, but it is not a good experience.

Installation is manual as of right now but if it reaches an acceptable state I will publish the crate on crates.

Goals and ideas can be found in goals.

The project structure as of right now should look like this:

project
│   Cargo.toml
│   build.rs
│   crates
│   └── comet
│   res
│   └── shaders
│   └── textures
│   └── sounds
│   src
│   └── main.rs
# Cargo.toml
# ...
[dependencies]
comet = { path = "path/of/the/comet/crate" }
# ...
// main.rs example
use comet::prelude::*;

struct Score(u8);

// This function will be called once before the event loop starts
fn setup(app: &mut App) {
  app.add_context(Score(0)); // Registers a shared context for the app.
}
// This function will be called every tick
fn update(app: &mut App, dt: f32) {}

fn main() {
    App::with_preset(App2D) // Creates a new `App` with the standard 2D modules
        .with_title("Comet App") // Sets the window title
        .with_icon("res://textures/comet_icon.png") // Sets the window icon
        .with_size(dp(1920.0), dp(1080.0)) // Sets the logical window size
        .run(setup, update) // Starts the app with the setup and update functions
}
// build.rs example

use anyhow::*;
use fs_extra::copy_items;
use fs_extra::dir::CopyOptions;
use std::env;
use std::path::PathBuf;

fn main() -> Result<()> {
  // Watch resource directories for changes
  println!("cargo:rerun-if-changed=res/materials/*");
  println!("cargo:rerun-if-changed=res/objects/*");
  println!("cargo:rerun-if-changed=res/textures/*");
  println!("cargo:rerun-if-changed=res/shaders/*");
  println!("cargo:rerun-if-changed=res/data/*");
  println!("cargo:rerun-if-changed=res/sounds/*");
  println!("cargo:rerun-if-changed=res/fonts/*");

  let profile = env::var("PROFILE")?;
  let manifest_dir = PathBuf::from(env::var("CARGO_MANIFEST_DIR")?);
  let target_dir = manifest_dir.join("target").join(&profile);

  let dest_resources_dir = target_dir.join("res");

  std::fs::create_dir_all(&dest_resources_dir)?;

  let mut copy_options = CopyOptions::new();
  copy_options.overwrite = true;
  copy_options.copy_inside = true;

  let resource_folders = vec![
    "res/materials/",
    "res/objects/",
    "res/textures/",
    "res/shaders/",
    "res/data/",
    "res/sounds/",
    "res/fonts/",
  ];

  let resource_paths: Vec<PathBuf> = resource_folders
          .iter()
          .map(|p| manifest_dir.join(p))
          .collect();

  copy_items(&resource_paths, &dest_resources_dir, &copy_options)?;

  Ok(())
}