recreate billard table and add ball movement
parent
818f1445b1
commit
9f30549790
@ -0,0 +1,19 @@
|
||||
[gd_scene load_steps=4 format=3 uid="uid://r1vdoioeyb53"]
|
||||
|
||||
[ext_resource type="ArrayMesh" uid="uid://bk3hh360blgwq" path="res://assets/ball.res" id="1_7s4qf"]
|
||||
[ext_resource type="Script" uid="uid://cq2m3ftgtcof5" path="res://scripts/ball.gd" id="1_cxlvu"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_7s4qf"]
|
||||
radius = 0.027
|
||||
|
||||
[node name="Ball" type="RigidBody3D"]
|
||||
script = ExtResource("1_cxlvu")
|
||||
|
||||
[node name="Mesh" type="MeshInstance3D" parent="."]
|
||||
mesh = ExtResource("1_7s4qf")
|
||||
|
||||
[node name="CollisionShape" type="CollisionShape3D" parent="."]
|
||||
shape = SubResource("SphereShape3D_7s4qf")
|
||||
|
||||
[connection signal="mouse_entered" from="." to="." method="_on_mouse_entered"]
|
||||
[connection signal="mouse_exited" from="." to="." method="_on_mouse_exited"]
|
||||
File diff suppressed because one or more lines are too long
@ -0,0 +1,10 @@
|
||||
extends RigidBody3D
|
||||
|
||||
var speed: float = 0.1
|
||||
|
||||
func _on_mouse_entered() -> void:
|
||||
var impulse: Vector3 = Vector3(randf() * speed, 0, randf() * speed)
|
||||
apply_impulse(impulse)
|
||||
|
||||
func _on_mouse_exited() -> void:
|
||||
pass # Replace with function body.
|
||||
@ -0,0 +1 @@
|
||||
uid://cq2m3ftgtcof5
|
||||
Loading…
Reference in New Issue