-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
84 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
Diff not rendered.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,48 @@ | ||
use bevy::prelude::*; | ||
use bevy::winit::cursor::CustomCursor; | ||
|
||
pub fn setup_cursor(mut commands: Commands, asset_server: Res<AssetServer>) { | ||
commands.insert_resource(CustomCursor::Image { | ||
handle: asset_server.load("cursor.png"), | ||
hotspot: (128, 128), | ||
}.into()); | ||
} | ||
// use bevy::prelude::*; | ||
// use bevy::window::SystemCursorIcon; | ||
// use bevy::winit::cursor::{CursorIcon, CustomCursor}; | ||
// | ||
// #[derive(Resource)] | ||
// pub struct CursorIcons(Vec<CursorIcon>); | ||
// | ||
// pub fn setup_cursor(mut commands: Commands, asset_server: Res<AssetServer>) { | ||
// commands.insert_resource(CursorIcons(vec![ | ||
// CustomCursor::Image { | ||
// handle: asset_server.load("cursors/cursor_default.png"), | ||
// hotspot: (23, 24), | ||
// } | ||
// .into(), | ||
// CustomCursor::Image { | ||
// handle: asset_server.load("cursors/cursor_select.png"), | ||
// hotspot: (23, 24), | ||
// } | ||
// .into(), | ||
// CustomCursor::Image { | ||
// handle: asset_server.load("cursors/cursor_progress.gif"), | ||
// hotspot: (23, 24), | ||
// } | ||
// .into(), | ||
// SystemCursorIcon::Text.into(), | ||
// ])); | ||
// } | ||
// | ||
// pub fn handle_cursor( | ||
// mut commands: Commands, | ||
// window: Single<Entity, With<Window>>, | ||
// input: Res<ButtonInput<MouseButton>>, | ||
// cursor_icons: Res<CursorIcons>, | ||
// ) { | ||
// if input.just_pressed(MouseButton::Left) { | ||
// commands | ||
// .entity(*window) | ||
// .insert(cursor_icons.0[1].clone()); | ||
// } else if input.just_released(MouseButton::Left) { | ||
// commands | ||
// .entity(*window) | ||
// .insert(cursor_icons.0[0].clone()); | ||
// } | ||
// | ||
// commands | ||
// .entity(*window) | ||
// .insert(cursor_icons.0[0].clone()); | ||
// } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,40 @@ | ||
pub mod player; | ||
mod cursor; | ||
pub mod menu; | ||
pub mod player; | ||
mod screen; | ||
mod text; | ||
mod cursor; | ||
|
||
use bevy::prelude::*; | ||
use bevy_rapier2d::prelude::*; | ||
use crate::menu::{menu_plugin, setup_camera, GameState}; | ||
use bevy::prelude::*; | ||
use bevy::window::{CursorMoved, WindowTheme}; | ||
use bevy::winit::cursor::{CursorIcon, CustomCursor}; | ||
use crate::cursor::setup_cursor; | ||
use bevy_rapier2d::prelude::*; | ||
|
||
pub const GAME_TITLE: &str = "Chronos Game"; | ||
|
||
fn main() { | ||
std::env::set_var("RUST_BACKTRACE", "1"); | ||
|
||
App::new() | ||
.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()).set( | ||
WindowPlugin { | ||
primary_window: Some(Window { | ||
title: GAME_TITLE.into(), | ||
window_theme: Some(WindowTheme::Dark), | ||
enabled_buttons: bevy::window::EnabledButtons { | ||
maximize: false, | ||
..Default::default() | ||
}, | ||
.add_plugins( | ||
DefaultPlugins | ||
.set(ImagePlugin::default_nearest()) | ||
.set(WindowPlugin { | ||
primary_window: Some(Window { | ||
title: GAME_TITLE.into(), | ||
window_theme: Some(WindowTheme::Dark), | ||
enabled_buttons: bevy::window::EnabledButtons { | ||
maximize: false, | ||
..Default::default() | ||
}, | ||
..default() | ||
}), | ||
..default() | ||
}), | ||
..default() | ||
} | ||
)) | ||
) | ||
.init_state::<GameState>() | ||
.add_systems(Startup, (setup_camera, setup_cursor)) | ||
.add_systems(Startup, (setup_camera /* * setup_cursor **/)) | ||
// .add_systems(Update, handle_cursor) | ||
.add_plugins(menu_plugin) | ||
.run(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters