Something went wrong. Try again.
🎠 Powerfull and simple 2D game engine with ecs based on raylib forked from vyacheslavhere.tngl.sh/carousel
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970use crate::{ assets::id::{AnimationId, AudioId, TextureId}, draw::color::Color,};
/// Defines a position component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Position(pub i32, pub i32);
/// Defines a rotation component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Rotation(pub f32);
/// Defines a scale rotation#[derive(Debug, PartialEq, Clone, Copy)]pub struct Scale(pub f32);
/// Defines a render order component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Order(pub usize);
/// Defines a shape kind#[derive(Debug, PartialEq, Clone, Copy)]pub enum ShapeKind { Rect { width: i32, height: i32, }, Triangle { v1: (i32, i32), v2: (i32, i32), v3: (i32, i32), }, Poly { sides: i32, radius: f32, }, Circle(f32),}
/// Defines a shape component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Shape(pub ShapeKind, pub Color);
/// Defines a sprite component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Sprite(pub TextureId);
/// Defines an animation puppet component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Puppet { pub animation: AnimationId, pub frame: usize,}
/// Defines a line component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Line { pub x1: i32, pub y1: i32, pub x2: i32, pub y2: i32, pub thick: f32, pub color: Color,}
/// Defines an sound component#[derive(Debug, PartialEq, Clone, Copy)]pub struct Audio(pub AudioId);