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
+9 -1
View File
@@ -1,8 +1,11 @@
extends CharacterBody2D
@onready var bullet = preload("res://assets/scenes/enemyBullet.tscn")
#@onready var bullet = preload("res://assets/scenes/enemyBullet.tscn")
@onready var explosionSFX = preload("res://assets/scenes/explosionsfx.tscn")
@onready var rollbackPickup = preload("res://assets/scenes/pickupables/stopwatch.tscn")
@onready var player = $"../../Player"
@onready var poly = $"Polygon2D"
@onready var animations = $AnimationPlayer
@@ -74,6 +77,11 @@ func _process(delta: float) -> void:
var exlopsion = explosionSFX.instantiate()
get_parent().get_parent().add_child(exlopsion)
if randi_range(1,5) == 1:
var instantiated = rollbackPickup.instantiate()
instantiated.global_position = global_position
get_parent().get_parent().add_child(instantiated)
queue_free()
func _physics_process(delta: float) -> void:
@@ -143,7 +151,7 @@ func _physics_process(delta: float) -> void:
instantiated.rotation = poly.rotation
instantiated.velocity.x = cos(poly.rotation) * 500
instantiated.velocity.y = sin(poly.rotation) * 500
instantiated.dealtScale = 1.5 * pow(wave, 0.2)
instantiated.dealtScale = 1.5 * pow(1.02, wave)
get_parent().get_parent().add_child(instantiated)
animations.play("shoot")
+4 -2
View File
@@ -1,6 +1,7 @@
extends Node
var availableUpgrades := ["dumbbell","firstAidKit", "rollback", "fasterFaster", "speedMayhem", "thoseWereTheDays", "dashMachine", "shotgun"]
var availableGoldUpgrade := ["shotgun", "dashMachine", "firstAidKit", "stopwatch"]
var upgradeDescriptions := {
"firstAidKit": "+50% time back",
@@ -8,15 +9,16 @@ var upgradeDescriptions := {
"rollback": "-20% speed up when taking damage",
"fasterFaster": "+15% speed",
"speedMayhem": "deal more damage with more speed",
"thoseWereTheDays": "every rollback, gain +10% damage",
"thoseWereTheDays": "every rollback, gain permanent +10% damage",
"dashMachine": "just a better dash.",
"shotgun": "a shotgun. literally just a fricking shotgun."
}
var goldUpgradeDescriptionOverrides := {
"firstAidKit": "i mean its now the second aid kit, right?",
"shotgun": "still a shotgun, but now shiny ooo",
"dashMachine": "dash everywhere, go wild.",
"stopwatch": "countdowns are 50% slower. its cool isn't it?",
"stopwatch": "new upgrade countdowns are 50% slower.",
"adrenaline": "when 5 seconds left on the health countdown, recieve a 75% buff on EVERYTHING.",
"threeWaves": "something is coming in three waves."
}
+9
View File
@@ -0,0 +1,9 @@
extends Area2D
var timer := 0.0
func _process(delta):
timer += delta
if timer > 1:
queue_free()
+1
View File
@@ -0,0 +1 @@
uid://dt85erj8ktqmq
+96 -1
View File
@@ -3,18 +3,113 @@ extends Control
@onready var bg = $TextureRect
@onready var title1 = $title1
@onready var title2 = $title2
@onready var title3 = $title3
@onready var playButton = $playButton
@onready var aboutButton = $aboutButton
@onready var shader = $shader
@onready var gun = $ColorRect/sprite
var timer := 0.0
var hoverPlay := false
var hoverSelect := false
var lock := false
var blurVal := 0.0
var tintVal := 0.0
var blurred := false
var currentPage := 0
func _ready():
Globals.unlockedUpgrades = {}
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta: float) -> void:
shader.material.set_shader_parameter("lod", blurVal)
shader.material.set_shader_parameter("color_tint", Color(0.0, 0.0, 0.0, tintVal))
gun.look_at(get_global_mouse_position())
if blurred:
blurVal += (3.0 - blurVal) * 5 * delta
tintVal += (0.5 - tintVal) * 5 * delta
if currentPage == 1:
$aboutPage.modulate.a += (1.0 - $aboutPage.modulate.a) * 5 * delta
if $aboutPage.modulate.a > 0.9 and Input.is_action_just_pressed("shoot"):
blurred = false
currentPage = 0
if currentPage == 2:
$briefPage.modulate.a += (1.0 - $briefPage.modulate.a) * 5 * delta
if $briefPage.modulate.a > 0.9 and Input.is_action_just_pressed("shoot"):
blurred = false
get_tree().change_scene_to_file("res://rootnode.tscn")
return
if currentPage == 0:
$aboutPage.modulate.a += (- $aboutPage.modulate.a) * 10 * delta
blurVal += (- blurVal) * 10 * delta
tintVal += (- tintVal) * 5 * delta
timer += delta
bg.position = get_local_mouse_position() / 200 - Vector2(16, 8)
#bg.position = get_local_mouse_position() / 200 - Vector2(16, 8)
bg.position.x = fmod((timer * 16), 48) - 48
bg.position.y = fmod((timer * 16), 48) - 48
title1.position.y = 120 + sin(timer) * 16
title2.position.y = 120 + sin(timer) * 16
title3.position.y = 120 + sin(timer - 1) * 16
if playButton.get_global_rect().has_point(get_global_mouse_position()):
if not hoverPlay:
$clilcksfx.play()
if Input.is_action_pressed("shoot"):
blurred = true
currentPage = 2
playButton.scale += (Vector2(1.25, 1.25) - playButton.scale) * 5 * delta
playButton.modulate.g += (0.23 - playButton.modulate.g) * 5 * delta
playButton.modulate.b += (0.23 - playButton.modulate.b) * 5 * delta
hoverPlay = true
else:
playButton.scale += (Vector2(1, 1) - playButton.scale) * 5 * delta
playButton.modulate.g += (1.0 - playButton.modulate.g) * 5 * delta
playButton.modulate.b += (1.0 - playButton.modulate.b) * 5 * delta
hoverPlay = false
if aboutButton.get_global_rect().has_point(get_global_mouse_position()):
if not hoverSelect:
$clilcksfx.play()
if Input.is_action_pressed("shoot"):
blurred = true
currentPage = 1
aboutButton.scale += (Vector2(1.25, 1.25) - aboutButton.scale) * 5 * delta
aboutButton.modulate.g += (0.23 - aboutButton.modulate.g) * 5 * delta
aboutButton.modulate.b += (0.23 - aboutButton.modulate.b) * 5 * delta
hoverSelect = true
else:
aboutButton.scale += (Vector2(1, 1) - aboutButton.scale) * 5 * delta
aboutButton.modulate.g += (1.0 - aboutButton.modulate.g) * 5 * delta
aboutButton.modulate.b += (1.0 - aboutButton.modulate.b) * 5 * delta
hoverSelect = false
func _on_play_button_mouse_entered() -> void:
pass # Replace with function body.
+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())
+5 -4
View File
@@ -21,9 +21,8 @@ func _physics_process(delta: float) -> void:
move_and_collide(velocity * delta)
func _on_area_entered(area: Area2D) -> void:
print("yes")
queue_free()
if not area.get_parent().has_meta("dontKillUrselfPlease"):
queue_free()
func _on_body_entered(body: Node2D) -> void:
@@ -31,7 +30,7 @@ func _on_body_entered(body: Node2D) -> void:
#body.get_node("explode").emitting = true
#body.get_node("explode").reparent(body.geat_parent())
body.health -= dmgtotal
body.health -= dmgtotal * player.damage_stack
body.knockback = Vector2(velocity.x * 0.5, velocity.y * 0.5)
body.hitsfx.play()
#AnimationPlayer.new().stop()
@@ -47,4 +46,6 @@ func _on_body_entered(body: Node2D) -> void:
#player.heal(randi_range(3,5))
#body.queue_free()
print(body.name)
queue_free()
+15 -7
View File
@@ -7,14 +7,21 @@ extends Control
@export var imDead := false
var upgradeID := ""
#var amount := 1
var timer := Globals.UPGRADE_TIMERSTART
var amount := 1
var timer = Globals.UPGRADE_TIMERSTART * pow(1.5, Globals.unlockedUpgrades.get("stopwatch", 0))
var goldUpgrade := false
func _ready():
if goldUpgrade:
progressRect.hide()
$goldrect.show()
timer = 999
func _process(delta: float) -> void:
if imDead and not $particles.emitting:
queue_free()
timer -= delta * Engine.time_scale
if not goldUpgrade: timer -= delta * Engine.time_scale
texture.scale += (Vector2(1, 1) - texture.scale) * 7 * delta
texture.modulate.a += (1 - texture.modulate.a) * 7 * delta
@@ -22,13 +29,14 @@ func _process(delta: float) -> void:
progressRect.position.x += (timer / Globals.UPGRADE_TIMERSTART * 48 - progressRect.position.x) * 5 * delta
progressRect.size.x += (48 - timer / Globals.UPGRADE_TIMERSTART * 48 - progressRect.size.x) * 5 * delta
amountLabel.text = str("x", Globals.unlockedUpgrades.get(upgradeID, -1))
amountLabel.text = str("x", amount)#Globals.unlockedUpgrades.get(upgradeID, -1))
if timer < 0 and not imDead:
amount -= 1
Globals.unlockedUpgrades[upgradeID] -= 1
timer = Globals.UPGRADE_TIMERSTART
if Globals.unlockedUpgrades[upgradeID] == 0:
Globals.unlockedUpgrades.erase(upgradeID)
if amount == 0:
#Globals.unlockedUpgrades.erase(upgradeID)
imDead = true
$texture.hide()
$progress.hide()
+168
View File
@@ -0,0 +1,168 @@
extends CharacterBody2D
@onready var bullet = preload("res://assets/scenes/enemyBullet.tscn")
#@onready var bullet = preload("res://assets/scenes/enemyBullet.tscn")
@onready var explosionSFX = preload("res://assets/scenes/explosionsfx.tscn")
@onready var explosion = preload("res://assets/scenes/explosion.tscn")
@onready var player = $"../../Player"
@onready var poly = $"Polygon2D"
@onready var animations = $AnimationPlayer
@onready var healthBar = $health
@onready var healthBg = $ColorRect
@onready var nav_agent: NavigationAgent2D = $NavigationAgent2D
@onready var ray:= $RayCast2D
@onready var hitsfx = $hitsfx
@onready var shootsfx = $shootsfx
const RANGE = 400.0
var curShootVal := 1.0
var lock := true
@export var shootDelay := 1.0
var health := 100.0
var maxHealth := 100.0
var wave := 1
var flash := 0.0
var knockback := Vector2.ZERO
var frameData = {}
var transitioning := false
var transitionState = [false, false, false]
var targetState = []
var ticks = 0
var tickToDel = 0
var boomTimer := 0.0
func moveback(seconds):
if ticks < 5: return
print("lets go")
targetState = frameData[max(tickToDel, ticks - (int(floor(seconds)) * 20))]
transitioning = true
func _ready():
animations.play("spawn")
await get_tree().create_timer(0.7).timeout
lock = false
call_deferred("actor_setup")
func actor_setup() -> void:
await get_tree().physics_frame
if player:
nav_agent.target_position = player.global_position
func _process(delta: float) -> void:
healthBar.size.x += ((health / maxHealth) * healthBg.size.x - healthBar.size.x) * 5 * delta
if health < 0:
if player:
if Globals.unlockedUpgrades.get("firstAidKit", 0) > 0:
player.heal(randf_range(3,5))
else:
player.heal(randf_range(2,3))
get_node("explode").emitting = true
get_node("explode").unlock = true
get_node("explode").reparent(get_parent().get_parent())
var exlopsion = explosionSFX.instantiate()
get_parent().get_parent().add_child(exlopsion)
queue_free()
func _physics_process(delta: float) -> void:
if lock:
return
if transitioning:
position += (targetState[0] - position) * 5 * delta / Engine.time_scale
rotation += (targetState[1] - rotation) * 5 * delta / Engine.time_scale
velocity += (targetState[2] - velocity) * 5 * delta / Engine.time_scale
#
#position = position.round()
#rotation = round(rotation)
#velocity = velocity.round()
#print((position - targetState[0]).length(), " ", abs(rotation - targetState[1]), " ", (velocity - targetState[2]).length())
if (position - targetState[0]).length() < 2:
position = targetState[0]
transitionState[0] = true
if abs(rotation - targetState[1]) < 0.05:
rotation = targetState[1]
transitionState[1] = true
if (velocity - targetState[2]).length() < 2:
velocity = targetState[2]
transitionState[2] = true
if transitionState.count(true) == len(transitionState):
transitioning = false
transitionState = [false, false, false]
targetState = []
return
var nextpos := nav_agent.get_next_path_position()
ray.rotation += ray.get_angle_to(player.global_position)
var distance = global_position.distance_to(player.global_position)
ray.target_position.x = min(distance, 400)
if not ray.is_colliding():
poly.rotation += poly.get_angle_to(player.global_position) * 5 * delta
velocity.x += (cos(poly.rotation) * 200 - velocity.x) * 5 * delta
velocity.y += (sin(poly.rotation) * 200 - velocity.y) * 5 * delta
else:
var newvel := (nextpos - global_position).normalized() * 200
poly.rotation += poly.get_angle_to(nextpos) * 5 * delta
velocity = newvel
#velocity += (newvel - velocity) * 5 * delta
#velocity.x += (cos(rotation) * 200 - velocity.x) * 5 * delta
#velocity.y += (sin(rotation) * 200 - velocity.y) * 5 * delta
knockback += -knockback * 5 * delta
boomTimer += delta
$Polygon2D.modulate.v = boomTimer / 5.0
if boomTimer > 5:
var instantiated = explosion.instantiate()
shootsfx.play()
instantiated.global_position = global_position
get_parent().get_parent().add_child(instantiated)
queue_free()
move_and_collide((velocity + knockback) * delta)
func _on_new_path() -> void:
if player:
nav_agent.target_position = player.global_position - Vector2(16, 16)
func _on_snappie_timeout() -> void:
frameData[ticks] = [position, rotation, velocity]
ticks += 1
if ticks > 240:
frameData.erase(tickToDel)
tickToDel += 1
+1
View File
@@ -0,0 +1 @@
uid://b4mt2p1i8cdix