Mode:
Duration:
1
Coding works best on desktop or with an external keyboard.
Coding works best on desktop or with an external keyboard.
Prints mouse coordinates each frame.
use bevy::prelude::*;
fn main() {
App::build()
.add_plugins(DefaultPlugins)
.add_system(mouse_position.system())
.run();
}
fn mouse_position(windows: Res<Windows>) {
if let Some(window) = windows.get_primary() {
if let Some(pos) = window.cursor_position() {
println!("Mouse: x={}, y={}", pos.x, pos.y);
}
}
}Bevy is a modern, open-source Rust game engine designed for high-performance 2D and 3D games, with a focus on ECS architecture, modularity, and cross-platform support for desktop and web.
Origin & Creator
Bevy was created by Carter Anderson and maintained by an open-source community, emphasizing Rust-native ECS and performance-focused game development.
Industrial Note
Bevy is gaining traction in Rust-native game development, educational games, indie 2D/3D games, simulations, and hobby projects where performance and safety are priorities.