Compare commits
7 Commits
2ffc0e8861
...
wasm
| Author | SHA1 | Date | |
|---|---|---|---|
| 9d9b25d1df | |||
| 89ee328807 | |||
| 90d8142855 | |||
| 10366b642c | |||
| 94e0cd0999 | |||
| 18d026637b | |||
| 51e6989ef4 |
4
.cargo/config.toml
Normal file
4
.cargo/config.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
[target.wasm32-unknown-unknown]
|
||||||
|
runner = "wasm-server-runner"
|
||||||
|
rustflags = ["--cfg", "getrandom_backend=\"wasm_js\""]
|
||||||
29
Cargo.toml
29
Cargo.toml
@@ -1,10 +1,33 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "asteroids"
|
name = "asteroids"
|
||||||
version = "0.2.0"
|
version = "0.3.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bevy = { version = "0.16", features = ["dynamic_linking"] }
|
bevy = "0.16"
|
||||||
bevy-inspector-egui = "0.32.0"
|
bevy-inspector-egui = "0.32.0"
|
||||||
bevy_rapier2d = { version = "0.31.0", features = ["debug-render-2d"] }
|
bevy_rapier2d = "0.31.0"
|
||||||
rand = "0.9.2"
|
rand = "0.9.2"
|
||||||
|
|
||||||
|
[features]
|
||||||
|
dynamic_linking = ["bevy/dynamic_linking"]
|
||||||
|
debug_ui = ["bevy_rapier2d/debug-render-2d"]
|
||||||
|
|
||||||
|
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||||
|
getrandom = { version = "0.3.3", features = ["wasm_js"] }
|
||||||
|
|
||||||
|
[profile.speedy]
|
||||||
|
inherits = "release"
|
||||||
|
codegen-units = 1
|
||||||
|
lto = "fat"
|
||||||
|
opt-level = 3
|
||||||
|
strip = "symbols"
|
||||||
|
panic = "abort"
|
||||||
|
|
||||||
|
[profile.tiny]
|
||||||
|
inherits = "release"
|
||||||
|
codegen-units = 1
|
||||||
|
lto = "fat"
|
||||||
|
opt-level = "z"
|
||||||
|
strip = "symbols"
|
||||||
|
panic = "abort"
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ pub const WINDOW_SIZE: bevy::prelude::Vec2 = bevy::prelude::Vec2::new(800.0, 600
|
|||||||
|
|
||||||
pub const UI_BUTTON_NORMAL: Color = Color::srgb(0.15, 0.15, 0.15); // Button color when it's just hanging out
|
pub const UI_BUTTON_NORMAL: Color = Color::srgb(0.15, 0.15, 0.15); // Button color when it's just hanging out
|
||||||
pub const UI_BUTTON_HOVERED: Color = Color::srgb(0.25, 0.25, 0.25); // ... when it's hovered
|
pub const UI_BUTTON_HOVERED: Color = Color::srgb(0.25, 0.25, 0.25); // ... when it's hovered
|
||||||
pub const UI_BUTTON_PRESSED: Color = Color::srgb(0.35, 0.75, 0.35); // ... when it's pressed
|
pub const UI_BUTTON_PRESSED: Color = Color::srgb(0.55, 0.55, 0.55); // ... when it's pressed
|
||||||
|
|
||||||
pub(crate) const BACKGROUND_COLOR: Color = Color::srgb(0.3, 0.3, 0.3);
|
pub(crate) const BACKGROUND_COLOR: Color = Color::srgb(0.3, 0.3, 0.3);
|
||||||
pub(crate) const PLAYER_SHIP_COLOR: Color = Color::srgb(1.0, 1.0, 1.0);
|
pub(crate) const PLAYER_SHIP_COLOR: Color = Color::srgb(1.0, 1.0, 1.0);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ use crate::{
|
|||||||
};
|
};
|
||||||
|
|
||||||
use bevy::{
|
use bevy::{
|
||||||
color::palettes::css::{BLACK, GREEN, LIGHT_BLUE, RED, WHITE},
|
color::palettes::css::{BLACK, DARK_GRAY, GREEN, LIGHT_BLUE, RED, WHITE},
|
||||||
prelude::*,
|
prelude::*,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -261,7 +261,7 @@ fn operate_buttons(
|
|||||||
match *interaction {
|
match *interaction {
|
||||||
Interaction::Pressed => {
|
Interaction::Pressed => {
|
||||||
*color = UI_BUTTON_PRESSED.into();
|
*color = UI_BUTTON_PRESSED.into();
|
||||||
border_color.0 = RED.into();
|
border_color.0 = DARK_GRAY.into();
|
||||||
match menu_action {
|
match menu_action {
|
||||||
ButtonMenuAction::ToMainMenu => {
|
ButtonMenuAction::ToMainMenu => {
|
||||||
game_state.set(GameState::TitleScreen);
|
game_state.set(GameState::TitleScreen);
|
||||||
|
|||||||
Reference in New Issue
Block a user