finish hello world just to be sure physics process werks

main
Bel LaPointe 2025-03-02 14:33:28 -07:00
parent b04ab122eb
commit a2f4fce705
1 changed files with 6 additions and 2 deletions

View File

@ -8,12 +8,16 @@ struct BreeLPlayer {
#[godot_api]
impl ISprite2D for BreeLPlayer {
fn init(base: Base<Sprite2D>) -> Self {
eprintln!("init");
BreeLPlayer{base: base}
}
fn physics_process(&mut self, delta: f64) {
eprintln!("physics_process({delta})");
let radians = (1.0 * delta) as f32;
self.base_mut().rotate(radians);
let rotation = self.base().get_rotation();
let velocity = Vector2::UP.rotated(rotation) * 200 as f32;
self.base_mut().translate(velocity * delta as f32);
}
}