• R/O
  • SSH

silny-kombat: Commit

Mercurial repo for silny-kombat project


Commit MetaInfo

Révision91d6889c64e5a59c1ccd2447347b93224cec27eb (tree)
l'heure2022-10-07 02:58:01
AuteurSecT
CommiterSecT

Message de Log

Collision checking - done

Change Summary

Modification

diff -r ce024c46d810 -r 91d6889c64e5 src/controller.rs
--- a/src/controller.rs Wed Sep 21 20:28:08 2022 +0200
+++ b/src/controller.rs Thu Oct 06 19:58:01 2022 +0200
@@ -205,7 +205,8 @@
205205 if stateA == 1 && stateB == 0
206206 {
207207 println!("Check collision A");
208- return (pos_A.x + 1.0 + char_width - pos_B.x).abs() <= 1.0;
208+ //workaround until jumping is not implemented - so characters can't get past each other
209+ // return (pos_A.x + 1.0 + char_width - pos_B.x).abs() <= 1.0;
209210 }
210211
211212 if stateA == 2 && stateB == 0
@@ -226,21 +227,24 @@
226227 if stateA == 0 && stateB == 2
227228 {
228229 println!("Check collision D");
229-
230- return (pos_A.x + char_width - pos_B.x + 1.0).abs() <= 1.0;
230+ //workaround until jumping is not implemented - so characters can't get past each other
231+ //return (pos_A.x + char_width - pos_B.x + 1.0).abs() <= 1.0;
231232 }
232233
233234 if stateA == 1 && stateB == 2
234235 {
235236 println!("Check collision E");
236237
237- return (pos_A.x + char_width - pos_B.x).abs() <= 2.0;
238+ return (pos_A.x + char_width - pos_B.x).abs() <= 10.0;
238239 }
239240
240241 if stateA == 2 && stateB == 1
241242 {
242- println!("Check collision F");
243- return (pos_A.x + char_width - pos_B.x ).abs() <= 1.0;
243+ let val = (pos_A.x + char_width - pos_B.x ).abs() ;
244+ println!("Check collision F : {}", val);
245+
246+ //return val < 1.0;
247+ return val <= 10.0;
244248 }
245249
246250 return false;
Afficher sur ancien navigateur de dépôt.