ABC Game Engine
ABC Game Engine
Hey HN! I have a background in Unity. Recently, I switched to Rust, but when I tried building a small game in Bevy it was difficult to pick up multithreaded entity components coming from a single-threaded game engine. ABC Game Engine aims to make it easier for users coming from Unity to pick up game development in Rust. Here's a simple example of a player controller in ABC Game Engine: struct PlayerController { speed: f32, jump_force: f32, } impl System for PlayerController { fn run(&mut self, entities_and_components: &mut EntitiesAndComponents) { let player_entity; let (player_x, player_y) = { let player_entities = entities_and_components .get_entities_with_component::<Player>() .cloned() .collect::<Vec<Entity>>(); player_entity = player_entities[0]; let (transform,) = entities_and_components.get_components::<(Transform,)>(player_entity); (transform.x, transform.y) }; let delta_time: f32; let mut normalized_dir = [0.0 as f32; 2]; { delta_time = entities_and_components .get_resource::<DeltaTime>() .expect("Failed to get DeltaTime resource") .get_delta_time() as f32; let physics_info = entities_and_components .get_resource::<RapierPhysicsInfo>() .expect("Failed to get PhysicsInfo resource"); let input = entities_and_components.get_resource::<Input>().unwrap(); if input.get_key_state(KeyCode::A) == KeyState::Held { normalized_dir[0] -= 1.0; } if input.get_key_state(KeyCode::D) == KeyState::Held { normalized_dir[0] += 1.0; } let intersection = physics_info.cast_ray( &Ray::new( vector![player_x as f32, player_y as f32 - 5.01].into(), vector![0.0, -1.0], ), Real::MAX, true, QueryFilter::default(), ); if input.get_key_state(KeyCode::Space) == KeyState::Pressed && intersection.is_some() { let intersection = intersection.unwrap(); if intersection.1 < 0.01 { normalized_dir[1] = 1.0; } } } if let (Some(_), Some(_), Some(rigid_body)) = entities_and_components .try_get_components_mut::<(Player, Transform, RigidBody)>(player_entity) { rigid_body.apply_impulse( vector![ normalized_dir[0] * self.speed * delta_time, normalized_dir[1] * self.jump_force, ], true, ); } } }
Share cardActual performance
Launch Intel predictions
Analyze your own launch →Incorrect prediction on native model
Similar products
Toy – A thin C++ game engine
I wrote my own RTS game engine in C
Tectonic Game Engine
TinyEngine – Game Engine for Microcontrollers
A UIKit Game Engine
HTML5 Game Engine
A Faux3D Game Engine I made in my spare time
Coffee2D – A simple HTML5 game engine
Gpt4-o is the new game engine
Game Engine Using LLVM and Ruby (XPlat Including WASM)