• R/O
  • SSH

silny-kombat: Commit

Mercurial repo for silny-kombat project


Commit MetaInfo

Revision2ace60778d79dcdd32f169bc6f60321cd6b8dc28 (tree)
Time2022-02-24 03:07:29
AuthorPiotr Kozka <piotoor@gmai...>
CommiterPiotr Kozka

Log Message

debug stuff

Change Summary

Incremental Difference

diff -r 9f41f1d753c9 -r 2ace60778d79 src/character_state_machine.rs
--- a/src/character_state_machine.rs Wed Jan 12 21:00:05 2022 +0100
+++ b/src/character_state_machine.rs Wed Feb 23 19:07:29 2022 +0100
@@ -35,7 +35,4 @@
3535 pub fn trigger_(&mut self, signal: CharacterFSMInput) -> Result<Option<CharacterFSMOutput>, TransitionImpossibleError> {
3636 self.machine.consume(&signal)
3737 }
38-
39-
40-
4138 }
diff -r 9f41f1d753c9 -r 2ace60778d79 src/controller.rs
--- a/src/controller.rs Wed Jan 12 21:00:05 2022 +0100
+++ b/src/controller.rs Wed Feb 23 19:07:29 2022 +0100
@@ -59,10 +59,12 @@
5959
6060 character_B.char_sprite.sprite.set_position(Vector2f::new(600.0, 0.0));
6161 character_B.char_sprite.sprite.set_scale(Vector2f::new(-1.0, 1.0));
62-
62+ let mut key_result = 3;
63+ let mut ply_1_left_pressed = false;
64+ let mut ply_1_right_pressed = false;
6365 loop {
6466 while let Some(event) = window.poll_event() {
65- let mut key_result = key_processor.match_key(event);
67+ key_result = key_processor.match_key(event);
6668 if key_result == 0 {
6769 //close program
6870 return;
@@ -75,31 +77,68 @@
7577 }
7678
7779
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)
85- }
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);
90- println!("-------------------------------");
91- match output {
92- Ok(v) => character_B.update_sprite(v),
93- Err(e) => println!("Unsupported key_result {}", key_result)
94- }
95- }
96- println!("-------------------------------");
80+ // if key_result < KeyProcessor::KEY_BASE {
81+ // //first char
82+ // // let output = process_key_result_for_character(&key_processor, &mut character_A, key_result);
83+ // // println!("-------------------------------");
84+ // // match output {
85+ // // Ok(v) => character_A.update_sprite(v),
86+ // // Err(e) => println!("Unsupported key_result {}", key_result)
87+ // // }
88+ // } else {
89+ // //second char
90+ //
91+ // // let output = process_key_result_for_character(&key_processor, &mut character_B, key_result);
92+ // // println!("-------------------------------");
93+ // // match output {
94+ // // Ok(v) => character_B.update_sprite(v),
95+ // // Err(e) => println!("Unsupported key_result {}", key_result)
96+ // // }
97+ // }
98+ // println!("-------------------------------");t = process_key_result_for_character(&key_processor, &mut character_B, key_result);
99+ // println!("-------------------------------");
100+ // match output {
101+ // Ok(v) => character_B.update_sprite(v),
102+ // Err(e) => println!("Unsupported key_result {}", key_result)
103+ // }
104+ // }
105+ // println!("-------------------------------");
106+ // println!("xxxxxxxxxxxxxxxxx key = {}", key_result);
107+ }
108+
109+ // if key_result < KeyProcessor::KEY_BASE {
110+ // let output = process_key_result_for_character(&key_processor, &mut character_A, key_result);
111+ // println!("xxxxxxxxxxxxxxx");
112+ // match output {
113+ // Ok(v) => character_A.update_sprite(v),
114+ // Err(e) => println!("Unsupported key_result {}", key_result)
115+ // }
116+ // } else {
117+ // key_result = key_result - KeyProcessor::KEY_BASE;
118+ println!("xxxxxxxxxxxxxxxxx key = {}", key_result);
119+ if key_result < KeyProcessor::KEY_BASE && key_result >= 0 {
120+ // let output = process_key_result_for_character(&key_processor, &mut character_A, key_result);
121+ // println!("xxxxxxxxxxxxxxxxx key = {}", key_result);
122+ // match output {
123+ // Ok(v) => character_A.update_sprite(v),
124+ // Err(e) => println!("Unsupported key_result {}", key_result)
125+ // // }
126+ // }
127+ } else {
128+ // key_result = key_result - KeyProcessor::KEY_BASE;
129+ // let output = process_key_result_for_character(&key_processor, &mut character_B, key_result);
130+ // println!("xxxxxxxxxxxxxxxxx key = {}", key_result);
131+ // match output {
132+ // Ok(v) => character_B.update_sprite(v),
133+ // Err(e) => println!("Unsupported key_result {}", key_result)
134+ // }
97135 }
98136
99137
138+
100139 window.clear(Color::rgb(50, 200, 50));
101- window.draw(&character_A.char_sprite.sprite);
102- window.draw(&character_B.char_sprite.sprite);
140+ // window.draw(&character_A.char_sprite.sprite);
141+ // window.draw(&character_B.char_sprite.sprite);
103142 window.display();
104143
105144 //end main loop
Show on old repository browser