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
25 changes: 0 additions & 25 deletions Callbacks.cpp

This file was deleted.

13 changes: 0 additions & 13 deletions Callbacks.h

This file was deleted.

2 changes: 2 additions & 0 deletions Code/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Normalize EOL for all files that Git considers text files.
* text=auto eol=lf
2 changes: 2 additions & 0 deletions Code/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/
18 changes: 18 additions & 0 deletions Code/End.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3 uid="uid://deb7q6h0om8hc"]

[ext_resource type="Texture2D" uid="uid://cbl4hf0ywmhvl" path="res://art/tiles/tiles.png" id="1_rogvg"]

[sub_resource type="RectangleShape2D" id="RectangleShape2D_xu2hy"]
size = Vector2(16, 16)

[node name="Platform" type="Area2D"]
z_index = -1
collision_mask = 2

[node name="Sprite2D" type="Sprite2D" parent="."]
texture = ExtResource("1_rogvg")
hframes = 5
frame = 4

[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("RectangleShape2D_xu2hy")
61 changes: 61 additions & 0 deletions Code/GameManager.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
extends Node

@onready var platforms = get_tree().get_nodes_in_group("platforms")
@onready var boxes = get_tree().get_nodes_in_group("boxes")

var all_platforms = []

func _ready():
# Initialize platforms and boxes
_initialize_platforms()
_initialize_boxes()

func _initialize_platforms():
all_platforms.clear()
for platform in platforms:
all_platforms.append({
"platform": platform,
"occupied": false
})

func get_occupied_platforms_count():
var occupied_count = 0
for platform_dict in all_platforms:
if platform_dict["occupied"] == true:
occupied_count += 1
return occupied_count

func _initialize_boxes():
# Ensure boxes are initialized after they are added to the scene
for box in boxes:
box.connect("on_platform_sig", Callable(self, "_on_box_moved_in"))
box.connect("out_platform_sig", Callable(self, "_on_box_moved_out"))

func _on_box_moved_in(platform):
_check_all_platforms_occupied(platform)

func _on_box_moved_out(platform):
for platform_info in all_platforms:
if platform_info["platform"] == platform:
platform_info["occupied"] = false
print("Updated platform state:", platform)
break

func _check_all_platforms_occupied(platform):
for platform_info in all_platforms:
if platform_info["platform"] == platform:
platform_info["occupied"] = true
print("Updated platform state:", platform_info)
break

var all_occupied = true
for platform_info in all_platforms:
if not platform_info["occupied"]:
all_occupied = false
break

func _load_next_level():
print("All platforms are occupied! Loading next level...")
var next_level_path = "res://levels/level_1.tscn"
if ResourceLoader.exists(next_level_path):
get_tree().change_scene_to_file(next_level_path)
6 changes: 6 additions & 0 deletions Code/GameManager.tscn
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[gd_scene load_steps=2 format=3 uid="uid://5q5c8pt7mew2"]

[ext_resource type="Script" path="res://GameManager.gd" id="1_apusa"]

[node name="GameManager" type="Node"]
script = ExtResource("1_apusa")
12 changes: 12 additions & 0 deletions Code/TileMap.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
extends TileMap

var GridSize = 16
var Dic = {}

# Called when the node enters the scene tree for the first time.
func _ready():
pass

# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(_delta):
pass
Binary file added Code/art/character_base_16x16.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 Code/art/character_base_16x16.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dn2kohmjttj4x"
path="res://.godot/imported/character_base_16x16.png-d0ca1337e67dbc2edda1321d0812f200.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/character_base_16x16.png"
dest_files=["res://.godot/imported/character_base_16x16.png-d0ca1337e67dbc2edda1321d0812f200.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 Code/art/guard_white_spritesheet.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 Code/art/guard_white_spritesheet.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://baficnup6ijqj"
path="res://.godot/imported/guard_white_spritesheet.png-46984e5542eb456a542bba799d88a295.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/guard_white_spritesheet.png"
dest_files=["res://.godot/imported/guard_white_spritesheet.png-46984e5542eb456a542bba799d88a295.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
34 changes: 34 additions & 0 deletions Code/art/robot_atlas.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://os7624ctmhq3"
path="res://.godot/imported/robot_atlas.png-4ab4b4dbdf78ee7f440d01daa2a63cc1.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/robot_atlas.png"
dest_files=["res://.godot/imported/robot_atlas.png-4ab4b4dbdf78ee7f440d01daa2a63cc1.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 Code/art/tiles/boxes.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 Code/art/tiles/boxes.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://qjc32syn3dc3"
path="res://.godot/imported/boxes.png-d6f585b944880e561f53fb5e334888d4.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/tiles/boxes.png"
dest_files=["res://.godot/imported/boxes.png-d6f585b944880e561f53fb5e334888d4.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 Code/art/tiles/robot_atlas.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 Code/art/tiles/robot_atlas.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://buebn1dqinyin"
path="res://.godot/imported/robot_atlas.png-aafbcbb2c6659dc8c261af26a5ca09c9.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/tiles/robot_atlas.png"
dest_files=["res://.godot/imported/robot_atlas.png-aafbcbb2c6659dc8c261af26a5ca09c9.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 Code/art/tiles/tiles.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 Code/art/tiles/tiles.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://cbl4hf0ywmhvl"
path="res://.godot/imported/tiles.png-e6a472d3e230306ae38f0521431a443d.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/tiles/tiles.png"
dest_files=["res://.godot/imported/tiles.png-e6a472d3e230306ae38f0521431a443d.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 Code/art/tiles/walls.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 Code/art/tiles/walls.png.import
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
[remap]

importer="texture"
type="CompressedTexture2D"
uid="uid://dqryivwwhqd0x"
path="res://.godot/imported/walls.png-c2e70823bc5348921734c4818ddbcb76.ctex"
metadata={
"vram_texture": false
}

[deps]

source_file="res://art/tiles/walls.png"
dest_files=["res://.godot/imported/walls.png-c2e70823bc5348921734c4818ddbcb76.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 Code/art/tiles/water.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading