Initial commit
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
/target
|
||||||
Generated
+6227
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,7 @@
|
|||||||
|
[package]
|
||||||
|
name = "down_into_the_void"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
bevy = "0.19.1"
|
||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
use bevy::{prelude::*, window::PresentMode};
|
||||||
|
|
||||||
|
mod player;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
App::new()
|
||||||
|
.add_plugins(DefaultPlugins.set(WindowPlugin {
|
||||||
|
primary_window: Some(Window {
|
||||||
|
title: "Down Into The Void".into(),
|
||||||
|
resolution: (1920, 1080).into(),
|
||||||
|
present_mode: PresentMode::AutoVsync,
|
||||||
|
..default()
|
||||||
|
}),
|
||||||
|
..default()
|
||||||
|
}))
|
||||||
|
.insert_resource(ClearColor(Color::srgb(0.0, 0.0, 0.0)))
|
||||||
|
.add_systems(Startup, setup)
|
||||||
|
.run();
|
||||||
|
}
|
||||||
|
|
||||||
|
fn setup(mut command: Commands) {
|
||||||
|
command.spawn(Camera2d);
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
const FALL_SPEED: f32 = 300.0; // Falling speed
|
||||||
|
const DIVE_SPEED: f32 = 700.0; // Falling speed sped up
|
||||||
|
const HORIZONTAL_SPEED: f32 = 300.0; // Lateral movement speed
|
||||||
|
|
||||||
|
// The player
|
||||||
|
#[derive(Component)]
|
||||||
|
struct Player;
|
||||||
|
|
||||||
|
// Speed of the player
|
||||||
|
#[derive(Component)]
|
||||||
|
struct Velocity(Vec2);
|
||||||
|
|
||||||
|
// Spawn player
|
||||||
|
fn spawn_player(mut command: Commands) {
|
||||||
|
command.spawn((
|
||||||
|
Player,
|
||||||
|
Velocity(Vec2::ZERO),
|
||||||
|
Sprite::from_color(Color::srgb(128.0, 0.0, 128.0), Vec2::new(20.0, 40.0)),
|
||||||
|
));
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user