A game engine
Find a file
2025-01-01 06:42:57 +01:00
crates fix: fixed import error in app.rs 2025-01-01 06:40:38 +01:00
resources/shaders feat: Added shader loading and swapping as well as beginnings of out of the box noise generation and support for multiple render passes 2024-12-17 01:36:34 +01:00
src Delete src/main.rs 2025-01-01 05:23:06 +00:00
build.rs initial commit 2024-10-26 02:15:26 +02:00
Cargo.toml fix: some things are outdated for some reason... 2025-01-01 06:21:32 +01:00
README.md fix: fixed main.rs in README.md 2025-01-01 06:42:57 +01:00

☄️ Comet

a free and open source games framework

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 exaptable state I will publish the crate

The project structure should look like this:

project
│   Cargo.toml
│   build.rs
│   crates
│   └── comet
│   resources
│   └── shaders
│   └── textures
│   src
│   └── main.rs
# Cargo.toml
# ...
[dependencies]
comet = { path = "crates/comet" }
# ...
// main.rs

// This will be cleaned up in the future 
// but for now I don't have a prelude.
use comet::{
  app::{
    App,
    ApplicationType::*
  },
  renderer::renderer2d::Renderer2D,
};

struct GameState {}

impl GameState {
  pub fn new() -> Self {
    Self {}
  }
}

// This function will be called once before the event loop starts
fn setup(app: &mut App, renderer: &mut Renderer2D) {}
// This function will be called every tick 
fn update(app: &mut App, renderer: &mut Renderer2D, dt: f32) {}

fn main() {
  App::new(App2D) // Generate a basic 2D app
          .with_title("Comet App") // Sets the window title
          .with_icon(r"resources/textures/comet_icon.png") // Sets the window icon
          .with_size(1920, 1080) // Sets the window size
          .with_game_state(GameState::new()) // Adds a custom game state struct
          .run::<Renderer2D>(setup, update) // Starts app
}
// build.rs

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

fn main() -> Result<()> {
  // This tells cargo to rerun this script if something in /resources/ changes.
  println!("cargo:rerun-if-changed=resources/textures/*");
  println!("cargo:rerun-if-changed=resources/shaders/*");

  let out_dir = env::var("OUT_DIR")?;
  let mut copy_options = CopyOptions::new();
  copy_options.overwrite = true;
  let mut paths_to_copy = Vec::new();
  paths_to_copy.push("resources/textures/");
  paths_to_copy.push("resources/shaders/");

  copy_items(&paths_to_copy, out_dir, &copy_options)?;

  Ok(())
}

Todo

(not ordered by importance)

  • Fixed update steps (60 updates per second right now)
  • Rendering
    • 2D
      • Textures
    • 3D
      • Meshes
      • Normal maps
    • Texture Atlas
    • Shaders
    • Materials
    • Text
    • Particles
    • Animations
    • Lighting
    • UI
      • Buttons
      • Input
    • Post-processing
      • Multiple render passes
      • Individual effects
  • Sound
  • Input
    • Universal input manager
    • Keyboard
    • Mouse
    • Gamepad
  • ECS
    • Components
    • Entities
    • Archetypes
    • World
  • Scene
    • loading
    • saving
  • Physics
    • 2D
    • 3D
  • Plugin System (at least right now)
    • Adding custom game state struct
    • Adding custom renderer
  • Math
    • Vectors
    • Matrices
    • Quaternions
    • Interpolation
    • Bezier curves
    • Easing functions
    • Noise
      • White
      • Perlin
      • Simplex
      • Worley
      • Fractal
      • Cellular
      • Gradient
      • Value
      • Cubic
    • Ray-casting
    • Pathfinding