• R/O
  • SSH

silny-kombat: Commit

Mercurial repo for silny-kombat project


Commit MetaInfo

Revision5b4b8b21c18462eb718c862978d4299e84c79e0c (tree)
Time2022-03-10 03:21:30
AuthorPiotr Kozka <piotoor@gmai...>
CommiterPiotr Kozka

Log Message

restored the main loop

Change Summary

Incremental Difference

diff -r 9f41f1d753c9 -r 5b4b8b21c184 src/controller.rs
--- a/src/controller.rs Wed Jan 12 21:00:05 2022 +0100
+++ b/src/controller.rs Wed Mar 09 19:21:30 2022 +0100
@@ -75,25 +75,27 @@
7575 }
7676
7777
78- if key_result < KeyProcessor::KEY_BASE {
79- //first char
80- let output = process_key_result_for_character(&key_processor, &mut character_A, key_result);
81- println!("-------------------------------");
82- match output {
83- Ok(v) => character_A.update_sprite(v),
84- Err(e) => println!("Unsupported key_result {}", key_result)
78+ if key_result != -1 {
79+ if key_result < KeyProcessor::KEY_BASE {
80+ //first char
81+ let output = process_key_result_for_character(&key_processor, &mut character_A, key_result);
82+ println!("-------------------------------");
83+ match output {
84+ Ok(v) => character_A.update_sprite(v),
85+ Err(e) => println!("Unsupported key_result {}", key_result)
86+ }
87+ } else {
88+ //second char
89+ key_result = key_result - KeyProcessor::KEY_BASE;
90+ let output = process_key_result_for_character(&key_processor, &mut character_B, key_result);
91+ println!("-------------------------------");
92+ match output {
93+ Ok(v) => character_B.update_sprite(v),
94+ Err(e) => println!("Unsupported key_result {}", key_result)
95+ }
8596 }
86- } else {
87- //second char
88- key_result = key_result - KeyProcessor::KEY_BASE;
89- let output = process_key_result_for_character(&key_processor, &mut character_B, key_result);
9097 println!("-------------------------------");
91- match output {
92- Ok(v) => character_B.update_sprite(v),
93- Err(e) => println!("Unsupported key_result {}", key_result)
94- }
9598 }
96- println!("-------------------------------");
9799 }
98100
99101
Show on old repository browser