multiple updates

This commit is contained in:
OddlyTimbot committed 2025-02-24 11:07:59 -05:00
1 parent d265ef4598
commit 246bdf0e98
18 files changed
+76 -58

No files matched your search

+13 -5
View File
@@ -29,7 +29,7 @@ metadata/_edit_group_ = true
shape = SubResource("WorldBoundaryShape2D_3u4a8")
[node name="RB_Crate" type="RigidBody2D" parent="."]
position = Vector2(99, 190)
position = Vector2(141, 231)
rotation = 0.545383
metadata/_edit_group_ = true
@@ -37,6 +37,15 @@ metadata/_edit_group_ = true
shape = SubResource("RectangleShape2D_4vo4d")
debug_color = Color(0.815686, 0.4, 0.207843, 0.419608)
[node name="RB_Crate2" type="RigidBody2D" parent="."]
position = Vector2(531, 193)
rotation = 0.545383
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="RB_Crate2"]
shape = SubResource("RectangleShape2D_4vo4d")
debug_color = Color(0.815686, 0.4, 0.207843, 0.419608)
[node name="level" type="Node2D" parent="."]
[node name="groundblock2" type="StaticBody2D" parent="level"]
@@ -48,7 +57,7 @@ position = Vector2(-1.5, 0)
shape = SubResource("RectangleShape2D_cq7kj")
[node name="groundblock3" type="StaticBody2D" parent="level"]
position = Vector2(404, 353)
position = Vector2(404, 345)
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="level/groundblock3"]
@@ -57,7 +66,6 @@ shape = SubResource("RectangleShape2D_cq7kj")
[node name="groundblock" type="StaticBody2D" parent="level"]
position = Vector2(124, 357)
collision_layer = 2
metadata/_edit_group_ = true
[node name="CollisionShape2D" type="CollisionShape2D" parent="level/groundblock"]
@@ -74,7 +82,7 @@ position = Vector2(-1.5, 0)
shape = SubResource("RectangleShape2D_cq7kj")
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]
position = Vector2(155, 328)
position = Vector2(82, 331)
collision_mask = 3
script = ExtResource("1_u4sui")
metadata/_edit_group_ = true
@@ -83,7 +91,7 @@ metadata/_edit_group_ = true
shape = SubResource("CircleShape2D_ubfw4")
[node name="Area2D" type="Area2D" parent="."]
position = Vector2(260, 352)
position = Vector2(624, 416)
script = ExtResource("2_nfj1w")
metadata/_edit_group_ = true
@@ -2,7 +2,7 @@ extends CharacterBody2D
const SPEED = 300.0
const JUMP_VELOCITY = -300.0
const JUMP_VELOCITY = -500.0
const PUSH_FORCE = 50
# Get the gravity from the project settings to be synced with RigidBody nodes.
+23 -7
View File
@@ -1,15 +1,31 @@
extends Node2D
var totalCrates = 2
var cratesCollected = 0
var timeLimit = 10
var timer:= Timer.new()
# Called when the node enters the scene tree for the first time.
func _ready():
pass # Replace with function body.
add_child(timer)
timer.wait_time = 1
timer.one_shot = false
timer.connect("timeout", secondCounter)
timer.start()
func secondCounter():
timeLimit -= 1
if timeLimit <=0:
print("You lose baby!")
get_tree().reload_current_scene()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_area_2d_areatrigger(effect, Object):
func _on_area_2d_areatrigger(effect, body):
print("Game Controller sees the trigger")
if body is RigidBody2D:
print("a crate entered trigger")
cratesCollected +=1
body.queue_free()
if cratesCollected>=totalCrates:
print("You win baby!")
get_tree().reload_current_scene()