Проектная работа - WIP

голова змеи и ее вращение
This commit is contained in:
6 changed files with 113 additions and 29 deletions
+17
View File
@@ -0,0 +1,17 @@
use bevy::prelude::*;
use crate::domain::Head;
pub fn head_rotation(
input: Res<ButtonInput<KeyCode>>,
mut query: Single<&mut Transform, With<Head>>,
) {
use core::f32::consts::PI;
if input.just_pressed(KeyCode::ArrowLeft) {
query.rotate_z(PI / 2.);
}
if input.just_pressed(KeyCode::ArrowRight) {
query.rotate_z(-PI / 2.);
}
}