Skip to content
Merged
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
Binary file modified assets/levels/level1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/levels/level2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/levels/level3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/levels/level4.aseprite
Binary file not shown.
Binary file added assets/levels/level4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/levels/level4.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cfms8xbl358ij"
path="res://.godot/imported/level4.png-b1590916da51e83b35d5f705a603e5bc.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/levels/level4.png"
dest_files=["res://.godot/imported/level4.png-b1590916da51e83b35d5f705a603e5bc.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added assets/levels/level5.aseprite
Binary file not shown.
Binary file added assets/levels/level5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/levels/level5.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://fujyqqj2ixes"
path="res://.godot/imported/level5.png-12eadc29069bfb51ed81dd9fb0c3a290.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/levels/level5.png"
dest_files=["res://.godot/imported/level5.png-12eadc29069bfb51ed81dd9fb0c3a290.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
Binary file added assets/levels/level6.aseprite
Binary file not shown.
Binary file added assets/levels/level6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions assets/levels/level6.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dnex8o58bdesr"
path="res://.godot/imported/level6.png-1c1b144c561e95255a697a698afc98d2.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://assets/levels/level6.png"
dest_files=["res://.godot/imported/level6.png-1c1b144c561e95255a697a698afc98d2.ctex"]

[params]

compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
1 change: 1 addition & 0 deletions scenes/collectables/directional_arrow.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
[ext_resource type="Texture2D" uid="uid://hrmsx523t5vm" path="res://assets/DirectionArrow.png" id="1_rh01a"]

[node name="DirectionalArrow" type="Node2D"]
z_index = 6
scale = Vector2(5, 5)
script = ExtResource("1_jf27l")

Expand Down
2 changes: 1 addition & 1 deletion scenes/globals.gd
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ func add_screenshake(amount: float):
screenshake.emit(amount)

func collectable_collected(type: String) -> void:
collected.emit(type)
if type == "crystal":
crystals_collected += 1
collected.emit(type)

func place_acid_aoe(position: Vector2, scaling: float) -> void:
acid_aoe.emit(position, scaling)
Expand Down
14 changes: 8 additions & 6 deletions scenes/hero.gd
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ class_name Hero
var can_shoot: bool = true
var can_melee: bool = true
var currently_in_lava: bool = false
var crystals_collected: int = 0
var teleporting: bool = false

@export var max_speed: int =500
Expand All @@ -20,6 +19,7 @@ var facing = 1.0
func _ready():
Globals.screenshake.connect(_on_screenshake)
Globals.collected.connect(_on_collectable_collected)
$Hud/HBoxContainer/CrystalLabel.text = str(Globals.crystals_collected)

func _process(_delta):
# Player faces the same direction as the weapon
Expand Down Expand Up @@ -53,9 +53,8 @@ func _on_screenshake(amount: float) -> void:

func _on_collectable_collected(type: String):
if type == "crystal":
crystals_collected += 1
#print("num collected: ", crystals_collected)
$Hud/HBoxContainer/CrystalLabel.text = str(crystals_collected)
$Hud/HBoxContainer/CrystalLabel.text = str(Globals.crystals_collected)
if type == "armor":
Globals.player_armor = Globals.player_max_armor

Expand Down Expand Up @@ -127,7 +126,8 @@ func burn(input:call_state):
if Globals.player_health <= 1:
die()
return
Globals.player_health -= 1
#Globals.player_health -= 1
hit(1)
animation_player.play("burning")
await get_tree().create_timer(1.0).timeout
burn(call_state.Hold)
Expand All @@ -150,7 +150,8 @@ func acidify(input: call_state):
if Globals.player_health <= 2:
die()
return
Globals.player_health -= 2
#Globals.player_health -= 2
hit(2)
animation_player.play("acidic")
await get_tree().create_timer(1.0).timeout
acidify(call_state.Hold)
Expand All @@ -165,7 +166,8 @@ func damage_over_time(damage: int, num_hits: int, wait_time: float, effect: Stri
if Globals.player_health <= damage:
die()
return
Globals.player_health -= damage
#Globals.player_health -= damage
hit(damage)
if effect == "Burning":
animation_player.play("burning")
await get_tree().create_timer(wait_time).timeout
Expand Down
2 changes: 2 additions & 0 deletions scenes/hero.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,8 @@ zoom = Vector2(0.7, 0.7)
script = ExtResource("3_mo806")

[node name="PlasmaRifle" parent="." instance=ExtResource("3_06baw")]
total_ttl = 1.25
cooldown = 0.25

[node name="Hud" parent="." instance=ExtResource("4_mv13s")]

Expand Down
96 changes: 73 additions & 23 deletions scenes/levels/level.gd
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,36 @@ extends Node2D
class_name Level

const TARGET_ROUND_B = preload("res://PlaceholderAssets/target_round_b.svg")
const MAX_LEVELS = 3
#const MAX_LEVELS = 3

var lava_aoe_scene = preload("res://scenes/aoes/lava_aoe.tscn")
const ACID_AOE = preload("res://scenes/aoes/acid_aoe.tscn")
const CRYSTAL = preload("res://scenes/collectables/crystal.tscn")
const SPAWNER = preload("res://scenes/enemies/spawner.tscn")
const ARMOR_PACK = preload("res://scenes/collectables/armor_pack.tscn")
const ACID_SLUG = preload("res://scenes/enemies/acid_slug.tscn")
const ICE_BEETLE = preload("res://scenes/enemies/ice_beetle.tscn")
const LAVA_ANT = preload("res://scenes/enemies/lava_ant.tscn")
const LEVEL_1: CompressedTexture2D = preload("res://assets/levels/level1.png")
const LEVEL_2: CompressedTexture2D = preload("res://assets/levels/level2.png")
const LEVEL_3: CompressedTexture2D = preload("res://assets/levels/level3.png")
const LEVEL_4: CompressedTexture2D = preload("res://assets/levels/level4.png")
const LEVEL_5: CompressedTexture2D = preload("res://assets/levels/level5.png")
const LEVEL_6: CompressedTexture2D = preload("res://assets/levels/level6.png")

const LEVELS = [
"res://scenes/levels/level1.tscn",
"res://scenes/levels/level2.tscn",
"res://scenes/levels/level3.tscn"
"res://scenes/levels/level3.tscn",
"res://scenes/levels/level4.tscn",
"res://scenes/levels/level5.tscn",
"res://scenes/levels/level6.tscn",
"res://scenes/levels/level7.tscn",
"res://scenes/levels/level8.tscn",
"res://scenes/levels/level9.tscn",
]

@export var current_level := 0
@export var current_level := 1
@export var jungle_ground := false
@export var jungle_wall := false

Expand All @@ -27,6 +40,12 @@ var level_images = {
"Level1" : LEVEL_1,
"Level2" : LEVEL_2,
"Level3" : LEVEL_3,
"Level4" : LEVEL_4,
"Level5" : LEVEL_5,
"Level6" : LEVEL_6,
"Level7" : LEVEL_4,
"Level8" : LEVEL_5,
"Level9" : LEVEL_6,
}

var hero: Hero
Expand All @@ -46,20 +65,24 @@ func _ready() -> void:
if enemy is LavaAnt:
enemy.connect("lava_aoe", _on_lava_ant_lava_aoe)
trigger_spawners()
Globals.player_health = 100
#Globals.player_health = 100
Globals.player_max_health = 100
Globals.player_armor = 0
Globals.player_max_armor = 100
#Globals.player_armor = 0
Globals.player_max_armor = 25
Globals.acid_aoe.connect(_on_acid_aoe)
if jungle_ground:
$TileMapLayers/JGroundLayerDual.show()
$TileMapLayers/GroundLayerDual.hide()
if jungle_wall:
$TileMapLayers/JRockWallsDual.show()
$TileMapLayers/RockWallsDual.hide()
load_level_from_image()
load_level_from_image(current_level)
hero = get_node('Hero')
hero.teleport_in()
if current_level % 2 == 0:
for enemy in $Enemies.get_children():
if enemy is Enemy:
enemy.switch_state(enemy.PURSUIT)

func _process(_delta):
if (_enemy_wave_cleared() and not _change_scene):
Expand All @@ -72,7 +95,7 @@ func _process(_delta):
func create_lava_aoe(pos, scaling):
var aoe = lava_aoe_scene.instantiate()
aoe.position = pos
aoe.scale = Vector2(scaling, scaling)
aoe.scale = Vector2(scaling, scaling) * 1.5
aoe.add_to_group("FireArea")
#$AOEs/LavaRegion.add_child(aoe)
$AOEs.add_child(aoe)
Expand Down Expand Up @@ -104,17 +127,17 @@ func _next_level():
current_level += 1
var scene_path
if current_level > LEVELS.size():
scene_path = 'res://scenes/utility/title.tscn'
scene_path = 'res://scenes/utility/end_screen.tscn'
else:
scene_path = LEVELS[current_level - 1]
get_tree().change_scene_to_file(scene_path)

func _on_intro_text_timer_timeout():
$CanvasLayer/TextOverlay.visible = false

func load_level_from_image() -> void:
func load_level_from_image(load_level: int) -> void:

var level_name = "Level" + str(current_level)
var level_name = "Level" + str(load_level)
if level_images.has(level_name):
num_enemies_spawned = 0
var image_file: CompressedTexture2D = level_images[level_name]
Expand Down Expand Up @@ -156,23 +179,41 @@ func load_level_from_image() -> void:
crystal.position = Vector2(x * 150, y * 150)
aoe_tilemap_image.set_pixel(x, y, Color.BLACK)
Color.RED:
var spawner:= SPAWNER.instantiate()
spawner.spawn_scene = spawner.LAVA_ANT
add_child(spawner)
spawner.position = Vector2(x * 150, y * 150)
if current_level <= 4:
var lava_ant = LAVA_ANT.instantiate()
spawn_enemy(lava_ant, Vector2(x * 150, y * 150))
else:
var spawner:= SPAWNER.instantiate()
spawner.spawn_scene = spawner.LAVA_ANT
add_child(spawner)
spawner.position = Vector2(x * 150, y * 150)
aoe_tilemap_image.set_pixel(x, y, Color.BLACK)
Color.MAGENTA:
var spawner:= SPAWNER.instantiate()
spawner.spawn_scene = spawner.ACID_SLUG
add_child(spawner)
spawner.position = Vector2(x * 150, y * 150)
if current_level <= 4:
var acid_slug := ACID_SLUG.instantiate()
spawn_enemy(acid_slug, Vector2(x * 150, y * 150))
else:
var spawner:= SPAWNER.instantiate()
spawner.spawn_scene = spawner.ACID_SLUG
add_child(spawner)
spawner.position = Vector2(x * 150, y * 150)
aoe_tilemap_image.set_pixel(x, y, Color.BLACK)
Color.CYAN:
var spawner:= SPAWNER.instantiate()
spawner.spawn_scene = spawner.ICE_BEETLE
add_child(spawner)
spawner.position = Vector2(x * 150, y * 150)
if current_level <= 4:
var ice_beetle := ICE_BEETLE.instantiate()
spawn_enemy(ice_beetle, Vector2(x * 150, y * 150))
else:
var spawner:= SPAWNER.instantiate()
spawner.spawn_scene = spawner.ICE_BEETLE
add_child(spawner)
spawner.position = Vector2(x * 150, y * 150)
aoe_tilemap_image.set_pixel(x, y, Color.BLACK)
Color.YELLOW:
var armor_pack := ARMOR_PACK.instantiate()
add_child(armor_pack)
armor_pack.position = Vector2(x * 150, y * 150)
aoe_tilemap_image.set_pixel(x, y, Color.BLACK)

Color.BLACK:
aoe_tilemap_image.set_pixel(x, y, Color.WHITE)
_ :
Expand Down Expand Up @@ -239,6 +280,15 @@ func trigger_spawners():
$Enemies.add_child(enemy)
num_enemies_spawned += 1

func spawn_enemy(instance, position) -> void:
instance.position = position
instance.target = $Hero
instance.collision_tilemap = $TileMapLayers/CollisionWallLayer
if instance is LavaAnt:
instance.connect("lava_aoe", _on_lava_ant_lava_aoe)
$Enemies.add_child(instance)
num_enemies_spawned += 1

func _on_enemy_died(type: String, pos: Vector2, scaling: float) -> void:
print(type)
match type:
Expand Down
8 changes: 1 addition & 7 deletions scenes/levels/level1.tscn
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
[gd_scene load_steps=3 format=3 uid="uid://b4u4kyf0gc6ly"]
[gd_scene load_steps=2 format=3 uid="uid://b4u4kyf0gc6ly"]

[ext_resource type="PackedScene" uid="uid://drmiw8rcswdmk" path="res://scenes/levels/level.tscn" id="1_x6ivy"]
[ext_resource type="PackedScene" uid="uid://dk0fef5g4cr4k" path="res://scenes/collectables/armor_pack.tscn" id="2_4tcl0"]

[node name="Level1" instance=ExtResource("1_x6ivy")]
current_level = 1
jungle_ground = true

[node name="ArmorPack" parent="." index="6" instance=ExtResource("2_4tcl0")]
position = Vector2(529, 586)
2 changes: 1 addition & 1 deletion scenes/levels/level2.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@

[node name="Level2" instance=ExtResource("1_e0cvd")]
current_level = 2
jungle_wall = true
jungle_ground = true
1 change: 1 addition & 0 deletions scenes/levels/level3.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@

[node name="Level3" instance=ExtResource("1_02w4s")]
current_level = 3
jungle_wall = true
Loading