added moving platforms and "collectable" coins and death barrier

This commit is contained in:
2024-09-07 13:13:05 -04:00
parent 709cee6893
commit 1573768619
12 changed files with 282 additions and 19 deletions

View File

@@ -179,12 +179,15 @@ radius = 21.0
height = 182.0
[node name="Tellick" type="CharacterBody2D"]
z_index = 100
collision_layer = 2
script = ExtResource("1_q21sg")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
position = Vector2(0, 2)
scale = Vector2(0.2, 0.2)
sprite_frames = SubResource("SpriteFrames_jl8dy")
autoplay = "default"
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CapsuleShape2D_aoset")

View File

@@ -1,6 +1,6 @@
extends CharacterBody2D
const SPEED = 300.0
const SPEED = 600.0
const JUMP_VELOCITY = -1000.0
const MAX_JUMP_DURATION = 0.3
const MIN_JUMP_DURATION = 0.01
@@ -46,3 +46,7 @@ func end_jump():
if velocity.y < 0:
velocity.y *= 0.20
is_jumping = false
func _on_kill_zone_body_entered(body: Node2D) -> void:
pass # Replace with function body.

Binary file not shown.

After

Width:  |  Height:  |  Size: 663 B

View File

@@ -0,0 +1,34 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://dj7grfg4awrf6"
path="res://.godot/imported/GoldCoin.png-25b6ee75d6b11e5a23115548c7f446c1.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://Assets/Collectables/GoldCoin.png"
dest_files=["res://.godot/imported/GoldCoin.png-25b6ee75d6b11e5a23115548c7f446c1.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

View File

@@ -0,0 +1,66 @@
[gd_scene load_steps=10 format=3 uid="uid://ctysf55pres8y"]
[ext_resource type="Texture2D" uid="uid://dj7grfg4awrf6" path="res://Assets/Collectables/GoldCoin.png" id="1_6uh7u"]
[ext_resource type="Script" path="res://Scripts/coin.gd" id="1_isgrf"]
[sub_resource type="AtlasTexture" id="AtlasTexture_6apv0"]
atlas = ExtResource("1_6uh7u")
region = Rect2(0, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_8md4o"]
atlas = ExtResource("1_6uh7u")
region = Rect2(16, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_ai3ca"]
atlas = ExtResource("1_6uh7u")
region = Rect2(32, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_sh070"]
atlas = ExtResource("1_6uh7u")
region = Rect2(48, 0, 16, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_pi3db"]
atlas = ExtResource("1_6uh7u")
region = Rect2(64, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_iigen"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_6apv0")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_8md4o")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_ai3ca")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_sh070")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_pi3db")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_piars"]
[node name="Coin" type="Area2D"]
collision_mask = 2
script = ExtResource("1_isgrf")
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
scale = Vector2(3, 3)
sprite_frames = SubResource("SpriteFrames_iigen")
autoplay = "default"
frame_progress = 0.137011
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
scale = Vector2(2.08, 2.08)
shape = SubResource("CircleShape2D_piars")
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="body_entered" from="." to="CollisionShape2D" method="_on_coin_body_entered"]

View File

@@ -0,0 +1,17 @@
[gd_scene load_steps=3 format=3 uid="uid://bqb3ccnlh1t0s"]
[ext_resource type="Texture2D" uid="uid://c8wfwo1nixh7d" path="res://Assets/World/Grounds/Dirt.png" id="1_4guyj"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_vncw8"]
size = Vector2(452, 48)
[node name="Platform" type="AnimatableBody2D"]
[node name="Sprite2D" type="Sprite2D" parent="."]
scale = Vector2(0.2, 0.2)
texture = ExtResource("1_4guyj")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
position = Vector2(-11, 0)
shape = SubResource("RectangleShape2D_vncw8")
one_way_collision = true

View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=3 format=3 uid="uid://cyumvt28wwf28"]
[ext_resource type="Script" path="res://Scripts/kill_zone.gd" id="1_vfalm"]
[sub_resource type="WorldBoundaryShape2D" id="WorldBoundaryShape2D_6667c"]
[node name="KillZone" type="Area2D"]
collision_mask = 2
script = ExtResource("1_vfalm")
[node name="Timer" type="Timer" parent="."]
wait_time = 0.6
one_shot = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("WorldBoundaryShape2D_6667c")
debug_color = Color(1, 0.012597, 0.0137024, 0.42)
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
[connection signal="timeout" from="Timer" to="." method="_on_timer_timeout"]