pub struct BulletDef { /* private fields */ }Expand description
A struct type that specifies the properties and behaviors of a bullet object in the game.
Implementations§
Source§impl BulletDef
impl BulletDef
Sourcepub fn set_end_effect(&mut self, val: &str)
pub fn set_end_effect(&mut self, val: &str)
Sets the effect that occurs when the bullet object ends its life.
Sourcepub fn get_end_effect(&self) -> String
pub fn get_end_effect(&self) -> String
Gets the effect that occurs when the bullet object ends its life.
Sourcepub fn set_life_time(&mut self, val: f32)
pub fn set_life_time(&mut self, val: f32)
Sets the amount of time in seconds that the bullet object remains active.
Sourcepub fn get_life_time(&self) -> f32
pub fn get_life_time(&self) -> f32
Gets the amount of time in seconds that the bullet object remains active.
Sourcepub fn set_damage_radius(&mut self, val: f32)
pub fn set_damage_radius(&mut self, val: f32)
Sets the radius of the bullet object’s damage area.
Sourcepub fn get_damage_radius(&self) -> f32
pub fn get_damage_radius(&self) -> f32
Gets the radius of the bullet object’s damage area.
Sourcepub fn set_high_speed_fix(&mut self, val: bool)
pub fn set_high_speed_fix(&mut self, val: bool)
Sets whether the bullet object should be fixed for high speeds.
Sourcepub fn is_high_speed_fix(&self) -> bool
pub fn is_high_speed_fix(&self) -> bool
Gets whether the bullet object should be fixed for high speeds.
Sourcepub fn set_gravity(&mut self, val: &Vec2)
pub fn set_gravity(&mut self, val: &Vec2)
Sets the gravity vector that applies to the bullet object.
Sourcepub fn get_gravity(&self) -> Vec2
pub fn get_gravity(&self) -> Vec2
Gets the gravity vector that applies to the bullet object.
Sourcepub fn get_body_def(&self) -> BodyDef
pub fn get_body_def(&self) -> BodyDef
Gets the physics body definition for the bullet object.
Sourcepub fn get_velocity(&self) -> Vec2
pub fn get_velocity(&self) -> Vec2
Gets the velocity vector of the bullet object.
Sourcepub fn set_as_circle(&mut self, radius: f32)
pub fn set_as_circle(&mut self, radius: f32)
Sourcepub fn set_velocity(&mut self, angle: f32, speed: f32)
pub fn set_velocity(&mut self, angle: f32, speed: f32)
Sets the velocity of the bullet object.
§Arguments
angle- The angle of the velocity in degrees.speed- The speed of the velocity.