Skip to content

Commit b8a5913

Browse files
committed
style: improve code comments for clarity and consistency
Updated comments in the codebase to ensure consistency in punctuation and clarity. This includes adding periods where missing and standardizing comment formatting to improve readability.
1 parent 3888ce7 commit b8a5913

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ impl INode for MainScene {
4343
impl MainScene {
4444
#[func]
4545
fn on_mob_timer_timeout(&mut self) {
46-
// Create mob instance
46+
// Create mob instance.
4747
let mut mob_spawn_location = self
4848
.base()
4949
.get_node_as::<PathFollow3D>("SpawnPath/SpawnLocation");
5050

5151
// Choose a random location on the SpawnPath.
52-
// Set random progress using proper rng
52+
// Set random progress using proper rng.
5353
mob_spawn_location.set_progress_ratio(rand::rng().random_range(0.0..=1.0));
5454

5555
// Communicate the spawn location and the player's location to the mob.

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ impl ICharacterBody3D for Player {
5151
// In the lines below, we turn the character when moving and make the animation play faster.
5252
direction = direction.normalized();
5353

54-
// take the pivot node and rotate it to face the direction we're moving in
54+
// Take the pivot node and rotate it to face the direction we're moving in.
5555
let mut pivot = self.base_mut().get_node_as::<Node3D>("Pivot");
5656

57-
// Setting the basis property will affect the rotation of the node
57+
// Setting the basis property will affect the rotation of the node.
5858
pivot.set_basis(Basis::looking_at(-direction, Vector3::UP, true));
5959
self.base()
6060
.get_node_as::<AnimationPlayer>("AnimationPlayer")
@@ -64,11 +64,11 @@ impl ICharacterBody3D for Player {
6464
.get_node_as::<AnimationPlayer>("AnimationPlayer")
6565
.set_speed_scale(1.0);
6666
}
67-
// Ground Velocity
67+
// Ground Velocity.
6868
self.target_velocity.x = direction.x * self.speed;
6969
self.target_velocity.z = direction.z * self.speed;
7070

71-
// jumping
71+
// jumping.
7272
if self.base().is_on_floor() && input.is_action_just_pressed("jump") {
7373
self.target_velocity.y = self.jump_impulse;
7474
}
@@ -106,7 +106,7 @@ impl ICharacterBody3D for Player {
106106
}
107107
}
108108
}
109-
// This makes the character follow a nice arc when jumping
109+
// This makes the character follow a nice arc when jumping.
110110
let mut pivot = self.base().get_node_as::<Node3D>("Pivot");
111111
let mut pivot_rotation = pivot.get_rotation();
112112
pivot_rotation.x = FRAC_PI_6 * self.base().get_velocity().y / self.jump_impulse;

0 commit comments

Comments
 (0)