• R/O
  • SSH

silny-kombat: Commit

Mercurial repo for silny-kombat project


Commit MetaInfo

Revision29c07ae25f970ca35edc7194e3584be5eb9f4509 (tree)
Time2021-10-08 03:53:39
AuthorSecT
CommiterSecT

Log Message

Frame implementation. Blocking controls for characters

Change Summary

Incremental Difference

diff -r 12bd3e576e27 -r 29c07ae25f97 src/controller.rs
--- a/src/controller.rs Wed Sep 29 21:03:19 2021 +0200
+++ b/src/controller.rs Thu Oct 07 20:53:39 2021 +0200
@@ -94,6 +94,8 @@
9494
9595 //let &mut mut stateReference: &mut i32;
9696
97+ let mut characterAInput : bool = false;
98+ let mut characterBInput : bool = false;
9799
98100 loop {
99101 while let Some(event) = window.poll_event() {
@@ -111,19 +113,44 @@
111113
112114 let mut character:Character;
113115
114- if key_result < KeyProcessor::KEY_BASE {
116+
117+
118+ if key_result < KeyProcessor::KEY_BASE && !characterAInput{
115119 //first char
116120 process_key_result_for_character(&keyProcessor, &mut character_A, key_result);
117121
118- } else {
122+ characterAInput = true;
123+
124+ if key_result == 3 {
125+ counter = 0;
126+ }
127+
128+ if characterAInput && characterBInput{
129+ characterAInput = false;
130+ characterBInput = false;
131+ }
132+
133+ } else if key_result >= KeyProcessor::KEY_BASE && !characterBInput {
119134 //second char
120135 key_result = key_result - KeyProcessor::KEY_BASE;
121136 process_key_result_for_character( &keyProcessor,&mut character_B, key_result);
137+
138+ characterBInput = true;
139+
140+ if key_result == 3 {
141+ counter = 0;
142+ }
143+
144+ if characterAInput && characterBInput{
145+ characterAInput = false;
146+ characterBInput = false;
147+ }
148+
122149 }
123150
124- if key_result == 3 {
125- counter = 0;
126- }
151+ // if key_result == 3 {
152+ // counter = 0;
153+ // }
127154
128155 // //first char/////////////
129156 // if key_result == 3 {
Show on old repository browser