Galactica/src/doodad.rs

24 lines
421 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,
pub height: 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,
height: self.height,
parallax: self.parallax,
};
}
}