22 lines
376 B
Rust
22 lines
376 B
Rust
use cgmath::{Deg, Point2};
|
|
|
|
use crate::{physics::Pfloat, Sprite, Spriteable};
|
|
|
|
pub struct Doodad {
|
|
pub sprite: String,
|
|
pub pos: Point2<Pfloat>,
|
|
pub parallax: Pfloat,
|
|
}
|
|
|
|
impl Spriteable for Doodad {
|
|
fn sprite(&self) -> Sprite {
|
|
return Sprite {
|
|
pos: self.pos,
|
|
name: self.sprite.clone(),
|
|
angle: Deg { 0: 0.0 },
|
|
scale: 1.0,
|
|
parallax: self.parallax,
|
|
};
|
|
}
|
|
}
|