This file contains hidden or 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
use bevy::{ | |
asset::RenderAssetUsages, | |
prelude::*, | |
render::mesh::{Indices, PrimitiveTopology}, | |
}; | |
use std::f32::consts::FRAC_PI_2; | |
/// A builder for creating a [`Mesh`] with an [`Annulus`] shape. | |
pub struct AnnularSectorMeshBuilder { | |
/// The [`Annulus`] shape. |
This file contains hidden or 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
#[test] | |
fn test_travel_htn() { | |
{ | |
// Don't need app for test, just want to set up the logger. | |
let mut app = App::new(); | |
app.add_plugins(bevy::log::LogPlugin::default()); | |
} | |
// DEFINE OPERATORS (which are behaviour trees) |
This file contains hidden or 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
/// A struct used to operate on reflected [`Event`] of a type. | |
/// | |
/// A [`ReflectEvent`] for type `T` can be obtained via | |
/// [`bevy::reflect::TypeRegistration::data`]. | |
#[derive(Clone)] | |
pub struct ReflectEvent(ReflectEventFns); | |
/// The raw function pointers needed to make up a [`ReflectEvent`]. | |
/// |
This file contains hidden or 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
use crate::prelude::*; | |
use bevy::{ | |
ecs::{intern::Interned, schedule::ScheduleLabel}, | |
prelude::*, | |
}; | |
use crate::{prepare::PrepareSet, sync::SyncSet}; | |
/// Quantizes all the things | |
pub struct QuantizationPlugin { |
This file contains hidden or 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
// RUST_LOG=info cargo test -- --nocapture test_state_machine | |
#[cfg(test)] | |
mod test { | |
use super::*; | |
#[derive(Resource, Default)] | |
struct Test { | |
on_b: bool, | |
on_any: bool, | |
} |
This file contains hidden or 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
use avian2d::prelude::{PhysicsDebugPlugin, PhysicsGizmos}; | |
use bevy::{input::common_conditions::input_just_pressed, prelude::*}; | |
pub mod prelude { | |
pub use super::PhysicsDebugToggle; | |
} | |
/// Controls if we run avians physicsdebug plugin to draw gizmos. | |
/// Field has a nice name so it shows up better in the egui resource inspector. | |
#[derive(Resource, Reflect, Default)] |
This file contains hidden or 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
``` | |
^(?:(?=[^:\\/]{4,253}) # Optional registry (non-capturing group) | |
(?!-) # Ensure no leading dash | |
[a-zA-Z0-9-]{1,63} # Allow alphanumeric and dashes (max 63 chars) | |
(?<!-) # Ensure no trailing dash | |
(?:\\.(?!-) # Allow dot-separated components, no dash after dot | |
[a-zA-Z0-9-]{1,63} # Same 63-char alphanumeric and dash rules | |
(?<!-))* # Zero or more of these subcomponents | |
(?::[0-9]{1,5})? # Optional port (e.g., :5000) | |
/)? # End of optional registry |
This file contains hidden or 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
name: WASM build and nginxify | |
on: | |
push: | |
tags: | |
- 'v*' | |
workflow_dispatch: | |
inputs: | |
version: | |
description: 'Version number in the format `v1.2.3`' |
This file contains hidden or 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
use crate::prelude::*; | |
use avian2d::prelude::*; | |
use bevy::prelude::*; | |
use lightyear::client::components::ComponentSyncMode; | |
use serde::{Deserialize, Serialize}; | |
pub mod prelude { | |
pub const BULLET_SIZE: f32 = 1.5; | |
pub use super::Bullet; | |
pub use super::BulletBundle; |
This file contains hidden or 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
use std::ops::Mul; | |
/// Handles acting on player inputs. Moving and shooting. | |
use crate::prelude::*; | |
use avian2d::prelude::*; | |
use bevy::{ecs::query::QueryData, prelude::*}; | |
use client::{is_in_rollback, Predicted}; | |
use leafwing_input_manager::{Actionlike, InputControlKind}; | |
use lightyear::client::input::leafwing::InputSystemSet; | |
use lightyear::{ |
NewerOlder