1
0

final commit

This commit is contained in:
2026-07-26 18:54:03 +02:00
parent 4438d9d886
commit c818fba5e9
45 changed files with 1791 additions and 67 deletions
+33 -7
View File
@@ -39,7 +39,13 @@ var targetState = []
var dead := false
var damage_stack := 1.0
var shotgun := 0
func heal(seconds):
damage_stack *= pow(1.1, Globals.unlockedUpgrades.get("thoseWereTheDays", 0))
newHealth = health + seconds
transitionStart.emit(seconds)
#print(frameData)
@@ -53,6 +59,11 @@ func _process(delta: float) -> void:
if damageScale > minDamageScale: damageScale -= delta
damageScale = max(damageScale, minDamageScale)
shotgun = Globals.unlockedUpgrades.get("shotgun", 0)
if shotgun > 0:
gunSprite.region_rect = Rect2(64, 80, 32, 16)
else:
gunSprite.region_rect = Rect2(0, 112, 16, 16)
#ticks += 1
dashRect.position.y = 31 * dashTimer / Globals.DASH_WAIT / 2 - 31.0 / 2
@@ -69,6 +80,7 @@ func _process(delta: float) -> void:
dead = true
hide()
var grayscaleVal := 1.0
func _physics_process(delta: float) -> void:
@@ -138,8 +150,8 @@ func _physics_process(delta: float) -> void:
var ang = gun.rotation + gun.get_angle_to(get_global_mouse_position())
if Input.is_action_just_pressed("dash") and dashTimer == 0:
dashVel = Vector2(cos(ang), sin(ang)) * Globals.DASH_LENGTH
dashTimer = Globals.DASH_WAIT
dashVel = Vector2(cos(ang), sin(ang)) * Globals.DASH_LENGTH * pow(1.5, Globals.unlockedUpgrades.get("dashMachine", 0))
dashTimer = Globals.DASH_WAIT * pow(0.8, Globals.unlockedUpgrades.get("dashMachine", 0))
if dashTimer > 0: dashTimer -= delta
else: dashTimer = 0
@@ -147,11 +159,19 @@ func _physics_process(delta: float) -> void:
if Input.is_action_just_pressed("shoot"):
if not animations.is_playing():
#var ang = gun.rotation + gun.get_angle_to(get_global_mouse_position())
var instantiated = bullet.instantiate()
instantiated.global_position = global_position
instantiated.velocity.x = cos(ang) * 700
instantiated.velocity.y = sin(ang) * 700
get_parent().add_child(instantiated)
if shotgun > 0:
for ind in range(-shotgun, shotgun + 1):
var instantiated = bullet.instantiate()
instantiated.global_position = global_position# + Vector2(cos(ang + ind * 0.2) * 16, sin(ang + ind * 0.3) * 16)
instantiated.velocity.x = cos(ang + ind * 0.2) * 700
instantiated.velocity.y = sin(ang + ind * 0.2) * 700
get_parent().add_child(instantiated)
else:
var instantiated = bullet.instantiate()
instantiated.global_position = global_position
instantiated.velocity.x = cos(ang) * 700
instantiated.velocity.y = sin(ang) * 700
get_parent().add_child(instantiated)
shootsfx.play()
@@ -197,3 +217,9 @@ func _on_hitbox_area_entered(area: Area2D) -> void:
area.queue_free()
$"../hud/AnimationPlayer2".play("global/popItUp")
if area.has_meta("kaboom"):
speedScale = 2 * pow(0.8, Globals.unlockedUpgrades.get("rollback", 0))
speedUp = 0.5
damageScale += 2 * pow(0.8, Globals.unlockedUpgrades.get("rollback", 0))
knockback = Vector2(sin(rotation) * 2000 * [0.5, -0.5].pick_random(), cos(rotation) * 2000 * [0.5, -0.5].pick_random())