MKRLBBZMDBIZEBXHRCBD2ZEKAUP4TPMOX6AC4ZOV4L2S7A7FWFPQC
Q7WHCTC4ARX6TBEKVX5HCHCDDFZ7VGCAY3WMS37ZI4F4NR36SBWQC
32P3IHGQEWNR6YN3DESLS4DKZJ55JLWA7LGLONKEDPSXFOEK34FAC
ZXAK75RPH25ZNDZ6VMIGXISHUEFWXNG6ROUY5OXK4UIADR4QJMTQC
O4C7RMEST2263UZERB2CU4S4JW3ICZ7UJWEVOTDTVNAF44SCP2DQC
ZBXFR4EQACOIJ35EETMJSL7VPWLGO3Z52BBUGLRTCF6OGQGUKWMAC
MDQDXQHZI3TV2PE4WUG2IQRKVHYDKIWCZYQIQLE74LNG6RPPR3YAC
SJTZ53IBAUM55GUNDXRRQY6BJHIT4L3UR656PMLMXS42ZQSWL2KQC
SRSAJDUS3GJP75CBMZHEAPRKBRG3M3PU3JSEL2KD7PGUCJX46YAQC
for mut transform in head_position.iter_mut() {
if keyboard_input.pressed(KeyCode::KeyA) {
transform.x -= 1;
}
if keyboard_input.pressed(KeyCode::KeyD) {
transform.x += 1;
}
if keyboard_input.pressed(KeyCode::KeyS) {
transform.y -= 1;
}
if keyboard_input.pressed(KeyCode::KeyW) {
transform.y += 1;
if let Some(mut head) = heads.iter_mut().next() {
let dir: Direction =
if keyboard_input.pressed(KeyCode::KeyA) {
Direction::Left
}
else if keyboard_input.pressed(KeyCode::KeyD) {
Direction::Right
}
else if keyboard_input.pressed(KeyCode::KeyS) {
Direction::Down
}
else if keyboard_input.pressed(KeyCode::KeyW) {
Direction::Up
} else {
head.direction
};
if dir != head.direction.opposite() {
head.direction = dir;