1
0
This commit is contained in:
FoxSpellCaster
2025-01-09 22:21:05 -05:00
parent 8d7c9eafd4
commit a8069211b7
5 changed files with 50 additions and 17 deletions

20
BaloonPopper/Balloon.tscn Normal file
View File

@@ -0,0 +1,20 @@
[gd_scene load_steps=5 format=3 uid="uid://dx4fsec1do8jf"]
[ext_resource type="Script" uid="uid://c30ldumgb7qiu" path="res://BaloonPopper/Balloon.gd" id="1_kf32r"]
[ext_resource type="Material" uid="uid://bdq28mtbdbb0n" path="res://BaloonPopper/Balloon.tres" id="2_c7wbr"]
[sub_resource type="SphereMesh" id="SphereMesh_7wxj3"]
[sub_resource type="SphereShape3D" id="SphereShape3D_x0uas"]
[node name="Balloon" type="Area3D"]
script = ExtResource("1_kf32r")
[node name="Model" type="MeshInstance3D" parent="."]
material_override = ExtResource("2_c7wbr")
mesh = SubResource("SphereMesh_7wxj3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="."]
shape = SubResource("SphereShape3D_x0uas")
[connection signal="input_event" from="." to="." method="_on_input_event"]

View File

@@ -1,23 +1,12 @@
[gd_scene load_steps=5 format=3 uid="uid://2ods25xi0dka"]
[gd_scene load_steps=3 format=3 uid="uid://2ods25xi0dka"]
[ext_resource type="Material" uid="uid://bdq28mtbdbb0n" path="res://BaloonPopper/Balloon.tres" id="1_5iqhe"]
[ext_resource type="Script" uid="uid://c30ldumgb7qiu" path="res://BaloonPopper/balloon.gd" id="1_f5668"]
[sub_resource type="SphereMesh" id="SphereMesh_7wxj3"]
[sub_resource type="SphereShape3D" id="SphereShape3D_x0uas"]
[ext_resource type="Script" uid="uid://cr25cj1q88j1m" path="res://BaloonPopper/BaloonManager.gd" id="1_degi4"]
[ext_resource type="PackedScene" uid="uid://dx4fsec1do8jf" path="res://BaloonPopper/Balloon.tscn" id="2_f5668"]
[node name="Main" type="Node3D"]
script = ExtResource("1_degi4")
[node name="Balloon" type="Area3D" parent="."]
script = ExtResource("1_f5668")
[node name="Model" type="MeshInstance3D" parent="Balloon"]
material_override = ExtResource("1_5iqhe")
mesh = SubResource("SphereMesh_7wxj3")
[node name="CollisionShape3D" type="CollisionShape3D" parent="Balloon"]
shape = SubResource("SphereShape3D_x0uas")
[node name="Balloon" parent="." instance=ExtResource("2_f5668")]
[node name="Camera3D" type="Camera3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 4)
@@ -26,4 +15,14 @@ current = true
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
transform = Transform3D(1, 0, 0, 0, 0.866025, 0.5, 0, -0.5, 0.866025, 0, 2, 3)
[connection signal="input_event" from="Balloon" to="Balloon" method="_on_input_event"]
[node name="Balloon2" parent="." instance=ExtResource("2_f5668")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.94194, 1.15659, 0)
[node name="Balloon3" parent="." instance=ExtResource("2_f5668")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.14232, 0)
[node name="Balloon4" parent="." instance=ExtResource("2_f5668")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 1.8991, 0, 0)
[node name="Balloon5" parent="." instance=ExtResource("2_f5668")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1.92766, 0, 0)

View File

@@ -0,0 +1,7 @@
extends Node3D
var score : int = 0
func increase_score (amount):
score += amount
print(score)

View File

@@ -0,0 +1 @@
uid://cr25cj1q88j1m

View File

@@ -8,3 +8,9 @@ var score_to_give : int = 1
func _on_input_event(camera, event, event_position, normal, shape_idx):
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed :
print ("Increase Balloon Size")
scale += Vector3.ONE * size_increase
clicks_to_pop -= 1
if clicks_to_pop == 0:
get_node("/root/Main").increase_score(score_to_give)
queue_free()