Skip to content

Commit

Permalink
trim spaces
Browse files Browse the repository at this point in the history
  • Loading branch information
barribob committed Jan 17, 2024
1 parent ca8d265 commit 9c696f8
Show file tree
Hide file tree
Showing 12 changed files with 57 additions and 55 deletions.
26 changes: 13 additions & 13 deletions ATTRIBUTION.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
## Collaborators

### Role
Person 1
Person 2
[Person w/ Link]()
Person 1
Person 2
[Person w/ Link]()


## Sourced / Unaffiliated
### Asset Type
#### Use Case
Author: [Name]()
Source: [Domain : webpage.html]()
Author: [Name]()
Source: [Domain : webpage.html]()
License: [License]()


## Tools
#### Godot
Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact)
Source: [godotengine.org](https://godotengine.org/)
License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt)
Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact)
Source: [godotengine.org](https://godotengine.org/)
License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt)

#### Git
Author: [Linus Torvalds](https://github.com/torvalds)
Source: [git-scm.com](https://git-scm.com/downloads)
Author: [Linus Torvalds](https://github.com/torvalds)
Source: [git-scm.com](https://git-scm.com/downloads)
License: [GNU General Public License version 2](https://opensource.org/licenses/GPL-2.0)

#### Godot Game Template
Author: [Marek Belski](https://github.com/Maaack)
Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template)
License: [MIT License](LICENSE.txt)
Author: [Marek Belski](https://github.com/Maaack)
Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template)
License: [MIT License](LICENSE.txt)
26 changes: 13 additions & 13 deletions ATTRIBUTION_example.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
## Collaborators

### Role
Person 1
Person 2
[Person w/ Link]()
Person 1
Person 2
[Person w/ Link]()


## Sourced / Unaffiliated
### Asset Type
#### Use Case
Author: [Name]()
Source: [Domain : webpage.html]()
Author: [Name]()
Source: [Domain : webpage.html]()
License: [License]()


## Tools
#### Godot
Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact)
Source: [godotengine.org](https://godotengine.org/)
License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt)
Author: [Juan Linietsky, Ariel Manzur, and contributors](https://godotengine.org/contact)
Source: [godotengine.org](https://godotengine.org/)
License: [MIT License](https://github.com/godotengine/godot/blob/master/LICENSE.txt)

#### Git
Author: [Linus Torvalds](https://github.com/torvalds)
Source: [git-scm.com](https://git-scm.com/downloads)
Author: [Linus Torvalds](https://github.com/torvalds)
Source: [git-scm.com](https://git-scm.com/downloads)
License: [GNU General Public License version 2](https://opensource.org/licenses/GPL-2.0)

#### Godot Game Template
Author: [Marek Belski](https://github.com/Maaack)
Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template)
License: [MIT License](LICENSE.txt)
Author: [Marek Belski](https://github.com/Maaack)
Source: [github: Godot-Game-Template](https://github.com/Maaack/Godot-Game-Template)
License: [MIT License](LICENSE.txt)
4 changes: 2 additions & 2 deletions App/Scenes/Menus/OptionsMenu/Input/InputOptionsMenu.gd
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ func _build_ui_tree():

func _assign_input_event(input_event : InputEvent, action_name : String):
assigned_input_events[InputEventHelper.get_text(input_event)] = action_name

func _assign_input_event_to_action(input_event : InputEvent, action_name : String) -> void:
_assign_input_event(input_event, action_name)
InputMap.action_add_event(action_name, input_event)
Expand Down Expand Up @@ -127,7 +127,7 @@ func _build_assigned_input_events():

func _get_action_for_input_event(input_event : InputEvent) -> String:
if InputEventHelper.get_text(input_event) in assigned_input_events:
return assigned_input_events[InputEventHelper.get_text(input_event)]
return assigned_input_events[InputEventHelper.get_text(input_event)]
return ""

func _horizontally_align_popup_labels():
Expand Down
8 changes: 5 additions & 3 deletions Enemy.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,29 @@ var player
var speed = 3.0
var move_lag : float = 16.0
var force_away_speed = 20.0
var health: float
var enemy_type: EnemyType

func _ready():
var model = enemy_type.model.instantiate()
add_child(model)
model.animation_player.play("RunFoward")
model.animation_player.play("RunFoward")
health = enemy_type.health

func _physics_process(delta):
if player:
look_at(player.global_position, Vector3.UP)
velocity = lerp(velocity, -transform.basis.z * speed, delta * move_lag)
else:
velocity = lerp(velocity, Vector2.ZERO, delta * move_lag)

move_and_slide()

func init(in_player, type):
player = in_player
player.player_damaged.connect(force_away)
enemy_type = type

func force_away(params):
var distance = (player.global_position - global_position).length()
if distance < 3:
Expand Down
2 changes: 1 addition & 1 deletion Item.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ var move_lag : float = 16.0

func start(in_player):
player = in_player

func _physics_process(delta):
if player.global_position.distance_squared_to(global_position) < pow(player.pick_up_range, 2):
look_at(player.global_position, Vector3.UP)
Expand Down
8 changes: 4 additions & 4 deletions Player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,11 @@ var current_velocity: Vector2

func _process(delta):
slowdown_cooldown = clampf(slowdown_cooldown - delta, 0, slowdown_time)

var xz_velocity = Vector3(velocity.x, 0, velocity.z)
var walk_dir = xz_velocity * model.basis
animation_tree.set("parameters/Locomotion/Locomotion/blend_position", Vector2(walk_dir.x, -walk_dir.z))

if (reticle.global_position - model.global_position).length() > 0.5:
var target_position = reticle.global_position
var new_transform = model.global_transform.looking_at(target_position, Vector3.UP)
Expand All @@ -37,7 +37,7 @@ func _process(delta):
func _physics_process(delta):
var slowed_down = slowdown_cooldown > 0
var speed = slowdown_while_shooting * move_speed if slowed_down else move_speed

current_input = Input.get_vector("move_left", "move_right", "move_up", "move_down")
var direction = (transform.basis * Vector3(current_input.x, 0, current_input.y)).normalized()
if direction:
Expand All @@ -53,7 +53,7 @@ var invincibility_time = 0.5
func _on_damageable_damaged(damage_params):
if is_invincible:
return

player_damaged.emit(damage_params)
is_invincible = true
var tween = create_tween()
Expand Down
4 changes: 2 additions & 2 deletions PlayerUI.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ func _ready():
func _on_shoot_handler_reload_start(cooldown):
if current_tween:
current_tween.kill()

current_tween = create_tween()
progress_bar.show()
progress_bar.value = 0
current_tween.tween_property(progress_bar, "value", 1.0, cooldown)
current_tween.tween_callback(progress_bar.hide)

func _on_shoot_handler_reload_cancel():
progress_bar.hide()
progress_bar.hide()
12 changes: 6 additions & 6 deletions ShootHandler.gd
Original file line number Diff line number Diff line change
Expand Up @@ -29,27 +29,27 @@ var upper_body_animation: AnimationNodeStateMachinePlayback

func _ready():
upper_body_animation = animation_tree.get("parameters/UpperBodyStateMachine/playback")
animation_tree.set("parameters/UpperBodyBlend/blend_amount", 0.0)
animation_tree.set("parameters/UpperBodyBlend/blend_amount", 0.0)

func _process(delta):
reticle.global_position = Utils.get_3d_mouse_pos(0.1, self, get_viewport().get_camera_3d())
pivot.look_at(reticle.global_position)

if is_reloading:
reload_cooldown = clampf(reload_cooldown - delta, 0, reload_time)
if Utils.leq(reload_cooldown, 0):
current_ammo = clip_size
is_reloading = false

shoot_cooldown = clampf(shoot_cooldown - delta, 0, shoot_interval)

if !shoot_button_down:
idle_time += delta
else:
idle_time = 0
idle_time = 0

if shoot_button_down and Utils.leq(shoot_cooldown, 0) and current_ammo > 0:
animation_tree.set("parameters/UpperBodyBlend/blend_amount", 0.95)
animation_tree.set("parameters/UpperBodyBlend/blend_amount", 0.95)
upper_body_animation.start("shoot")
shoot()
fired.emit()
Expand All @@ -67,7 +67,7 @@ func _process(delta):
reload_cooldown = reload_time
is_reloading = true
reload_start.emit(reload_time)

func _unhandled_input(event):
if event is InputEventMouseButton and event.is_action("shoot"):
shoot_button_down = event.is_pressed()
Expand Down
8 changes: 4 additions & 4 deletions UpgradeHandler.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ func _ready():
func add_upgrade(upgrade: Upgrade):
if not upgrades_by_type.has(upgrade.upgrade_type):
upgrades_by_type[upgrade.upgrade_type] = []

upgrades_by_type[upgrade.upgrade_type].append(upgrade)
recalculate_upgrade_type(upgrade.upgrade_type)

func recalculate_upgrade_type(upgrade_type):
var fire_rate_upgrade = 0.0
var reload_speed_upgrade = 0.0
var clip_size_upgrade: int = 0
var pick_up_range_upgrade = 0.0
var move_speed_upgrade = 0.0

for upgrade in upgrades_by_type[upgrade_type]:
fire_rate_upgrade += upgrade.fire_rate
reload_speed_upgrade += upgrade.reload_speed
clip_size_upgrade += upgrade.clip_size
pick_up_range_upgrade += upgrade.pick_up_range
move_speed_upgrade += upgrade.move_speed

shoot_handler.shoot_interval = shoot_handler.base_shoot_interval / (1 + fire_rate_upgrade)
shoot_handler.reload_time = shoot_handler.base_reload_time / (1 + reload_speed_upgrade)
shoot_handler.clip_size = shoot_handler.base_clip_size + clip_size_upgrade
Expand Down
4 changes: 2 additions & 2 deletions UpgradePanel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ extends Control

func _ready():
close_and_resume()

func leveled_up():
open_and_pause()

func upgrade_chosen(upgrade):
close_and_resume()

func close_and_resume():
get_tree().paused = false
hide()
Expand Down
4 changes: 2 additions & 2 deletions Utils.gd
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ static func get_3d_mouse_pos(y_pos: float, node: Node3D, camera: Camera3D):
var mouse_pos = node.get_viewport().get_mouse_position()
var ray_origin = camera.project_ray_origin(mouse_pos)
var ray_direction = camera.project_ray_normal(mouse_pos)

var intersection_point = Vector3()

# Calculate the intersection of the ray with the plane
Expand All @@ -18,7 +18,7 @@ static func get_3d_mouse_pos(y_pos: float, node: Node3D, camera: Camera3D):
if t >= 0:
intersection_point = ray_origin + ray_direction * t
return intersection_point

return Vector3.ZERO

static func geq(f1: float, f2: float):
Expand Down
6 changes: 3 additions & 3 deletions addons/console/Console.gd
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func _ready() -> void:

func _input(event : InputEvent) -> void:
if (!OS.is_debug_build()):
get_tree().paused = false
get_tree().paused = false
return
if (event is InputEventKey):
if (event.get_physical_keycode_with_modifiers() == KEY_QUOTELEFT): # ~ key.
Expand Down Expand Up @@ -122,13 +122,13 @@ func autocomplete() -> void:
return
else:
suggesting = true

var sorted_commands := []
for command in console_commands:
sorted_commands.append(str(command))
sorted_commands.sort()
sorted_commands.reverse()

var prev_index := 0
for command in sorted_commands:
if command.contains(line_edit.text):
Expand Down

0 comments on commit 9c696f8

Please sign in to comment.