• R/O
  • SSH

silny-kombat: Commit

Mercurial repo for silny-kombat project


Commit MetaInfo

Revision9f41f1d753c9938afa1ed225391fc6571f9dc2d9 (tree)
Time2022-01-13 05:00:05
AuthorPiotr Kozka <piotoor@gmai...>
CommiterPiotr Kozka

Log Message

Updated modulo values. Players now move more smoothly

Change Summary

Incremental Difference

diff -r 3f4295f010ee -r 9f41f1d753c9 src/sprite_rendering.rs
--- a/src/sprite_rendering.rs Wed Nov 10 21:13:40 2021 +0100
+++ b/src/sprite_rendering.rs Wed Jan 12 21:00:05 2022 +0100
@@ -28,12 +28,12 @@
2828 }
2929
3030 fn move_left(&mut self) {
31- let v = Vector2f::new(-1.0, 0.0);
31+ let v = Vector2f::new(-10.0, 0.0);
3232 self.sprite.move_(v);
3333 }
3434
3535 pub fn move_right(&mut self) {
36- let v = Vector2f::new(1.0, 0.0);
36+ let v = Vector2f::new(10.0, 0.0);
3737 self.sprite.move_(v);
3838 }
3939
@@ -46,33 +46,33 @@
4646
4747 if state == 0
4848 {
49- if self.counter % 10 == 0
49+ if self.counter % 4 == 0
5050 {
5151 self.sprite.set_texture(&self.textures[1], true);
5252 }
53- if self.counter % 20 == 0
53+ if self.counter % 8 == 0
5454 {
5555 self.sprite.set_texture(&self.textures[0], true);
5656 }
5757 } else if state == 1
5858 {
5959 self.move_right();
60- if self.counter % 10 == 0
60+ if self.counter % 4 == 0
6161 {
6262 self.sprite.set_texture(&self.textures[2], true);
6363 }
64- if self.counter % 20 == 0
64+ if self.counter % 8 == 0
6565 {
6666 self.sprite.set_texture(&self.textures[3], true);
6767 }
6868 } else if state == 2
6969 {
7070 self.move_left();
71- if self.counter % 10 == 0
71+ if self.counter % 4 == 0
7272 {
7373 self.sprite.set_texture(&self.textures[3], true);
7474 }
75- if self.counter % 20 == 0
75+ if self.counter % 8 == 0
7676 {
7777 self.sprite.set_texture(&self.textures[2], true);
7878 }
Show on old repository browser