Lesson 2
This commit is contained in:
7
BaloonPopper/Balloon.tres
Normal file
7
BaloonPopper/Balloon.tres
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
[gd_resource type="StandardMaterial3D" format=3 uid="uid://bdq28mtbdbb0n"]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
albedo_color = Color(1, 0, 0, 1)
|
||||||
|
roughness = 0.25
|
||||||
|
rim_enabled = true
|
||||||
|
rim_tint = 1.0
|
||||||
@@ -1,4 +1,7 @@
|
|||||||
[gd_scene load_steps=3 format=3 uid="uid://2ods25xi0dka"]
|
[gd_scene load_steps=5 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="SphereMesh" id="SphereMesh_7wxj3"]
|
||||||
|
|
||||||
@@ -6,12 +9,14 @@
|
|||||||
|
|
||||||
[node name="Main" type="Node3D"]
|
[node name="Main" type="Node3D"]
|
||||||
|
|
||||||
[node name="Baloon" type="Area3D" parent="."]
|
[node name="Balloon" type="Area3D" parent="."]
|
||||||
|
script = ExtResource("1_f5668")
|
||||||
|
|
||||||
[node name="Model" type="MeshInstance3D" parent="Baloon"]
|
[node name="Model" type="MeshInstance3D" parent="Balloon"]
|
||||||
|
material_override = ExtResource("1_5iqhe")
|
||||||
mesh = SubResource("SphereMesh_7wxj3")
|
mesh = SubResource("SphereMesh_7wxj3")
|
||||||
|
|
||||||
[node name="CollisionShape3D" type="CollisionShape3D" parent="Baloon"]
|
[node name="CollisionShape3D" type="CollisionShape3D" parent="Balloon"]
|
||||||
shape = SubResource("SphereShape3D_x0uas")
|
shape = SubResource("SphereShape3D_x0uas")
|
||||||
|
|
||||||
[node name="Camera3D" type="Camera3D" parent="."]
|
[node name="Camera3D" type="Camera3D" parent="."]
|
||||||
@@ -20,3 +25,5 @@ current = true
|
|||||||
|
|
||||||
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
[node name="DirectionalLight3D" type="DirectionalLight3D" parent="."]
|
||||||
transform = Transform3D(1, 0, 0, 0, 0.866025, 0.5, 0, -0.5, 0.866025, 0, 2, 3)
|
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"]
|
||||||
10
BaloonPopper/balloon.gd
Normal file
10
BaloonPopper/balloon.gd
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
extends Area3D
|
||||||
|
|
||||||
|
var clicks_to_pop : int = 3
|
||||||
|
var size_increase : float = 0.2
|
||||||
|
var score_to_give : int = 1
|
||||||
|
|
||||||
|
# If mouse is left click when pressed
|
||||||
|
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")
|
||||||
1
BaloonPopper/balloon.gd.uid
Normal file
1
BaloonPopper/balloon.gd.uid
Normal file
@@ -0,0 +1 @@
|
|||||||
|
uid://c30ldumgb7qiu
|
||||||
Reference in New Issue
Block a user