• R/O
  • SSH

silny-kombat: Commit

Mercurial repo for silny-kombat project


Commit MetaInfo

Revisionbdcbe80165cc6f51258fe8eb24b105246a77e888 (tree)
Time2022-02-04 03:54:30
AuthorSecT
CommiterSecT

Log Message

Refactoring - MAX_COUNTER_VALUE

Change Summary

Incremental Difference

diff -r 8c381616eb27 -r bdcbe80165cc src/sprite_rendering.rs
--- a/src/sprite_rendering.rs Wed Jan 12 21:10:43 2022 +0100
+++ b/src/sprite_rendering.rs Thu Feb 03 19:54:30 2022 +0100
@@ -17,6 +17,8 @@
1717 impl<'a> CharacterSprite<'a>{
1818 //fn new(new_sprite: &'a Sprite) -> Self{
1919 //pub fn new(new_sprite: &'a mut Sprite<'a>) -> Self{
20+ const MAX_COUNTER_VALUE: i32 = 20000;
21+
2022 pub fn new(textures: &'a [&SfBox<Texture>]) -> Self{
2123 let sprite = Sprite::new();
2224 CharacterSprite{
@@ -81,7 +83,7 @@
8183
8284 self.counter = self.counter + 1;
8385
84- if self.counter > 20000
86+ if self.counter > CharacterSprite::MAX_COUNTER_VALUE
8587 {
8688 self.counter = 0;
8789 }
Show on old repository browser