Trait mold2d::Actor [] [src]

pub trait Actor<Type, Message> {
    fn render(
        &mut self,
        context: &mut Context,
        viewport: &mut Viewport,
        elapsed: f64
    ); fn handle_message(&mut self, message: &Message) -> Message; fn collides_with(
        &mut self,
        other_actor: &ActorData<Type>
    ) -> Option<CollisionSide>; fn update(&mut self, context: &mut Context, elapsed: f64) -> PositionChange; fn data(&mut self) -> ActorData<Type>; }

A game object that supports sending and receiving messages

Required Methods

Called every frame to render an actor

Handle a message sent by another actor

Returns the side of the collision if actor collides with another actor

Called every frame to update an actor

Gets the actor data

Implementors