added input

This commit is contained in:
bQUARKz 2026-01-14 09:21:01 +00:00
parent f7077ffec0
commit 84ab6bd40c
Signed by: bquarkz
SSH Key Fingerprint: SHA256:Z7dgqoglWwoK6j6u4QC87OveEq74WOhFN+gitsxtkf8

View File

@ -159,7 +159,7 @@ impl Machine {
player.bank_id = 2;
player.tile.id = 1;
player.priority = 4;
player.tile.palette_id = 1; // YELLOW
player.tile.palette_id = 4; // ORANGE
// Movimento contínuo (enquanto segura)
let move_speed = 2;
@ -169,8 +169,8 @@ impl Machine {
if self.pad.right.down { player.x += move_speed; }
// Trigger (apenas no frame que apertou)
if self.pad.a.pressed {
player.tile.palette_id = 4;
if self.pad.a.down {
player.tile.palette_id = 2;
}
// Exemplo de uso do released
@ -178,12 +178,12 @@ impl Machine {
// Se soltar o Start, podemos pausar algo futuramente
}
// // Post-FX Fade Pulsante
// let pulse = (self.frame_index / 4) % 64;
// let level = if pulse > 31 { 63 - pulse } else { pulse };
// self.gfx.scene_fade_level = level as u8;
// self.gfx.scene_fade_color = Color::BLACK;
// self.gfx.hud_fade_level = 31;
// Post-FX Fade Pulsante
let pulse = (self.frame_index / 4) % 64;
let level = if pulse > 31 { 63 - pulse } else { pulse };
self.gfx.scene_fade_level = level as u8;
self.gfx.scene_fade_color = Color::BLACK;
self.gfx.hud_fade_level = 31;
}
/// Final do frame: troca buffers.