Skip to content

Commit e1cf6fc

Browse files
committed
Add 5th Yarwin suggestion:
"Use i32/u32 instead. In original demo it is just an Int: https://github.com/godotengine/godot-demo-projects/blob/4.2-31d1c0c/3d/squash_the_creeps/ScoreLabel.gd"
1 parent 0935ad2 commit e1cf6fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

squash-the-creeps/rust/src/scorelabel.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use godot::prelude::*;
44
#[derive(GodotClass)]
55
#[class(init, base=Control)]
66
pub struct UserInterface {
7-
score: f32,
7+
score: u32,
88
base: Base<Control>,
99
}
1010

1111
#[godot_api]
1212
impl UserInterface {
1313
#[func]
1414
pub fn on_mob_squashed(&mut self) {
15-
self.score += 1.0;
15+
self.score += 1;
1616

1717
let mut label = self.base().get_node_as::<Label>("ScoreLabel");
1818
label.set_text(format!("Score: {}", self.score).as_str());

0 commit comments

Comments
 (0)