pub struct Object {
pub pos: Vector,
pub spd: Vector,
pub rem: Vector,
pub spr: u8,
pub hitbox: Rectangle,
pub flip: FlipState,
pub collidable: bool,
pub solids: bool,
pub obj_type: ObjectType,
pub draw: ObjFunc,
pub update: ObjFunc,
pub name: &'static str,
}Fields§
§pos: Vector§spd: Vector§rem: Vector§spr: u8§hitbox: Rectangle§flip: FlipState§collidable: bool§solids: bool§obj_type: ObjectType§draw: ObjFunc§update: ObjFunc§name: &'static strImplementations§
Source§impl Object
impl Object
pub fn draw(&mut self, celeste: &mut Celeste)
pub fn update(&mut self, celeste: &mut Celeste)
pub fn left(&self) -> f32
pub fn right(&self) -> f32
pub fn top(&self) -> f32
pub fn bottom(&self) -> f32
pub fn init_smoke(&self, celeste: &mut Celeste, x: f32, y: f32)
pub fn draw_sprite(&self, celeste: &mut Celeste)
pub fn do_move(&mut self, celeste: &mut Celeste, ox: f32, oy: f32, start: f32)
pub fn check( &mut self, celeste: &mut Celeste, name: &'static str, x: f32, y: f32, ) -> Option<usize>
pub fn is_ice(&self, x: f32, y: f32, celeste: &mut Celeste) -> bool
pub fn is_solid(&mut self, x: f32, y: f32, celeste: &mut Celeste) -> bool
pub fn is_flag(&self, x: f32, y: f32, flag: u8, celeste: &mut Celeste) -> bool
Sourcepub fn init_fruit(&mut self, celeste: &mut Celeste, ox: f32, oy: f32)
pub fn init_fruit(&mut self, celeste: &mut Celeste, ox: f32, oy: f32)
and then they turned themself into a strawberry. funniest shit i’ve ever seen
Sourcepub fn destroy_self(&mut self, celeste: &mut Celeste)
pub fn destroy_self(&mut self, celeste: &mut Celeste)
WARNING: Only use this function if it is being called by the object itself in an update loop
pub fn destroy_other(&mut self, celeste: &mut Celeste)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Object
impl<'de> Deserialize<'de> for Object
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Object
impl !RefUnwindSafe for Object
impl !Send for Object
impl !Sync for Object
impl Unpin for Object
impl !UnwindSafe for Object
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more