Initial commit: Godot 4.7 pixel platformer prototype

Player: move/jump (Space), test flight (F, debug builds only). Key: pickup, hold S to aim with live trajectory preview, release to throw, W to warp to the thrown key. Spring bounce. Spikes deal damage. 3-heart health, Z consumes a heal item for +1 heart and a 5s shield. HUD with hearts and item count. Death screen with fade-to-black and restart. Hidden passages. Assets: Kenney Pixel Platformer (CC0).
This commit is contained in:
2026-10-07 20:32:42 +08:00
commit 9dffacd938
558 changed files with 12258 additions and 0 deletions
@@ -0,0 +1,19 @@
[gd_scene load_steps=4 format=3]
[ext_resource type="Texture2D" path="res://assets/game/collectibles/coin_gold_round.png" id="1_texture"]
[ext_resource type="Script" path="res://scripts/collectible.gd" id="2_collectible"]
[sub_resource type="CircleShape2D" id="Shape_coin"]
radius = 5.0
[node name="CoinGoldRound" type="Area2D" groups=["collectible"]]
collision_layer = 16
collision_mask = 2
script = ExtResource("2_collectible")
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="PickupArea" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_coin")
@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Texture2D" path="res://assets/game/collectibles/coin_gold_thin.png" id="1_texture"]
[sub_resource type="RectangleShape2D" id="Shape_coin"]
size = Vector2(7, 13)
[node name="CoinGoldThin" type="Area2D" groups=["collectible"]]
collision_layer = 16
collision_mask = 2
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="PickupArea" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_coin")
+18
View File
@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Texture2D" path="res://assets/game/collectibles/gem_blue.png" id="1_texture"]
[sub_resource type="CircleShape2D" id="Shape_gem"]
radius = 6.0
[node name="GemBlue" type="Area2D" groups=["collectible"]]
collision_layer = 16
collision_mask = 2
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="PickupArea" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_gem")
+23
View File
@@ -0,0 +1,23 @@
[gd_scene load_steps=5 format=3]
[ext_resource type="Texture2D" path="res://assets/game/tilesets/kenney_tiles_atlas.png" id="1_atlas"]
[ext_resource type="Script" path="res://scripts/key.gd" id="2_key"]
[sub_resource type="AtlasTexture" id="AtlasTexture_key"]
atlas = ExtResource("1_atlas")
region = Rect2(126, 18, 18, 18)
[sub_resource type="CircleShape2D" id="Shape_pickup"]
radius = 7.0
[node name="KeyGold" type="Area2D"]
collision_layer = 16
collision_mask = 2
script = ExtResource("2_key")
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = SubResource("AtlasTexture_key")
[node name="PickupArea" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_pickup")
@@ -0,0 +1,35 @@
[gd_scene load_steps=6 format=3]
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_canopy_left.png" id="1_left"]
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_canopy_middle.png" id="2_middle"]
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_canopy_right.png" id="3_right"]
[ext_resource type="Texture2D" path="res://assets/game/vegetation/tree_trunk.png" id="4_trunk"]
[sub_resource type="RectangleShape2D" id="Shape_trunk"]
size = Vector2(14, 18)
[node name="TreeSmall" type="StaticBody2D"]
collision_layer = 1
collision_mask = 0
[node name="CanopyLeft" type="Sprite2D" parent="."]
texture_filter = 1
position = Vector2(-18, -18)
texture = ExtResource("1_left")
[node name="CanopyMiddle" type="Sprite2D" parent="."]
texture_filter = 1
position = Vector2(0, -18)
texture = ExtResource("2_middle")
[node name="CanopyRight" type="Sprite2D" parent="."]
texture_filter = 1
position = Vector2(18, -18)
texture = ExtResource("3_right")
[node name="Trunk" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("4_trunk")
[node name="Collision" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_trunk")
+20
View File
@@ -0,0 +1,20 @@
[gd_scene load_steps=4 format=3]
[ext_resource type="Texture2D" path="res://assets/game/obstacles/spikes_double.png" id="1_texture"]
[ext_resource type="Script" path="res://scripts/hazard.gd" id="2_hazard"]
[sub_resource type="RectangleShape2D" id="Shape_spikes"]
size = Vector2(16, 8)
[node name="SpikesDouble" type="Area2D" groups=["hazard"]]
collision_layer = 4
collision_mask = 2
script = ExtResource("2_hazard")
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="DetectionArea" type="CollisionShape2D" parent="."]
position = Vector2(0, 4)
shape = SubResource("Shape_spikes")
@@ -0,0 +1,30 @@
[gd_scene load_steps=5 format=3]
[ext_resource type="Texture2D" path="res://assets/game/interactables/spring_red.png" id="1_texture"]
[ext_resource type="Script" path="res://scripts/spring.gd" id="2_spring"]
[sub_resource type="RectangleShape2D" id="Shape_spring_body"]
size = Vector2(16, 10)
[sub_resource type="RectangleShape2D" id="Shape_spring_trigger"]
size = Vector2(18, 14)
[node name="SpringRed" type="StaticBody2D" groups=["spring"]]
collision_layer = 1
collision_mask = 0
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="Collision" type="CollisionShape2D" parent="."]
position = Vector2(0, 3)
shape = SubResource("Shape_spring_body")
[node name="BounceArea" type="Area2D" parent="."]
collision_layer = 8
collision_mask = 2
script = ExtResource("2_spring")
[node name="TriggerShape" type="CollisionShape2D" parent="BounceArea"]
shape = SubResource("Shape_spring_trigger")
@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Texture2D" path="res://assets/game/signs/direction_sign_left.png" id="1_texture"]
[sub_resource type="RectangleShape2D" id="Shape_sign"]
size = Vector2(18, 18)
[node name="DirectionSignLeft" type="StaticBody2D"]
collision_layer = 1
collision_mask = 0
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="Collision" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_sign")
@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Texture2D" path="res://assets/game/signs/direction_sign_right.png" id="1_texture"]
[sub_resource type="RectangleShape2D" id="Shape_sign"]
size = Vector2(18, 18)
[node name="DirectionSignRight" type="StaticBody2D"]
collision_layer = 1
collision_mask = 0
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="Collision" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_sign")
+18
View File
@@ -0,0 +1,18 @@
[gd_scene load_steps=3 format=3]
[ext_resource type="Texture2D" path="res://assets/game/structures/crate.png" id="1_texture"]
[sub_resource type="RectangleShape2D" id="Shape_crate"]
size = Vector2(18, 18)
[node name="Crate" type="StaticBody2D"]
collision_layer = 1
collision_mask = 0
[node name="Sprite" type="Sprite2D" parent="."]
texture_filter = 1
texture = ExtResource("1_texture")
[node name="Collision" type="CollisionShape2D" parent="."]
shape = SubResource("Shape_crate")