M
Size: a a a
M
ED
async fn death_animation() {
for i in 0..70 {
for gameobject in scene::all_scene_objects() {
if let Some(obstacle) = gameobject.downcast_mut::<Obstacle>() {
obstacle.x *= 0.8;
let h = obstacle.bottom - obstacle.top;
if obstacle.top <= -9.5 {
obstacle.bottom = -10. + h * (100 - i) as f32 / 100.;
} else {
obstacle.top = 10. - h * (100 - i) as f32 / 100.;
}
}
if let Some(bird) = gameobject.downcast_mut::<Bird>() {
bird.pos *= Vec2::new(0.9, 0.9);
}
}
next_frame().await;
}
wait_seconds(0.1).await;
scene::clear();
}
G
await await await
с множественными вызовамиM
M
M
ED
G
G
M
M
G
ED
M
G
ED
M
G
G