Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Entities/Player/player.gd
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ func _process(_delta: float) -> void:

func _shoot_cannon(global_pos: Vector2, direction: Vector2) -> void:
shoot_behavior.shoot(get_parent(), global_pos, direction)

# workaround to discourage spamming powerup weapons
if not shoot_behavior is DefaultShootBehavior:
powerup_timer.start( clamp(powerup_timer.time_left - 2, 0.1, 100 ) )


func hit() -> void:
Expand Down
4 changes: 2 additions & 2 deletions Scenes/Game/CurrentManager.gd
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extends Node2D

var tot_current: Vector2
var current: Vector2
var time: float
var time: float = RandomNumberGenerator.new().randf_range(0.0, 1000000.0)
var water_mat: Material

func _ready():
Expand All @@ -22,7 +22,7 @@ func _process(delta):
var magnitude = 50
current.y = sin(time / dir_speed) * magnitude
current.x = cos(time / dir_speed) * magnitude
current *= clamp(sin(time / gust_duration) / 2 + 0.5, 0, 1)
current *= clamp(cos(time / gust_duration) / 2 + 0.5, 0, 1)

tot_current += current * -delta
water_node.material.set_shader_parameter("CurrentDirection", tot_current)
Expand Down
1 change: 1 addition & 0 deletions Scenes/Game/game.gd
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ func _ready() -> void:
player.player = i
player.global_position = $SpawnPoints.get_child( i ).global_position
player.current_manager = $CurrentManager
player.look_at(Vector2.ZERO)
add_child(player)

var wake: Wake = _wake_scene.instantiate()
Expand Down