Compare commits

..

No commits in common. "d221962270f468e1a3fda472addc92541ca0b1f6" and "33333714e2b3dad71d37ea74e6fa863f7466076a" have entirely different histories.

6 changed files with 13 additions and 45 deletions

View File

@ -13,6 +13,3 @@ occlussion shader: https://www.reddit.com/r/godot/comments/rww6e9/comment/hrfa51
Sound: Sound:
billiard-clack: https://freesound.org/people/Za-Games/sounds/539854/ billiard-clack: https://freesound.org/people/Za-Games/sounds/539854/
https://freesound.org/people/original_sound/sounds/372197/

BIN
godot/audio/error.mp3 (Stored with Git LFS)

Binary file not shown.

View File

@ -1,19 +0,0 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://bg07vavc0duo5"
path="res://.godot/imported/error.mp3-e904d198a343e1da5de4876587f3ccef.mp3str"
[deps]
source_file="res://audio/error.mp3"
dest_files=["res://.godot/imported/error.mp3-e904d198a343e1da5de4876587f3ccef.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View File

@ -11,7 +11,6 @@ var camera_tweening = false
func _ready(): func _ready():
set_target(initial_target, false) set_target(initial_target, false)
camera.set_as_top_level(true)
ControllerEventBus.billiard_touched_billiard.connect(_on_billiard_touched_billiard) ControllerEventBus.billiard_touched_billiard.connect(_on_billiard_touched_billiard)
func _on_billiard_touched_billiard(who: Billiard, touched: Billiard): func _on_billiard_touched_billiard(who: Billiard, touched: Billiard):
@ -27,17 +26,14 @@ func get_charge():
func _input(event): func _input(event):
var billiard := target.get_billiard() var billiard := target.get_billiard()
if camera_tweening or not MouseControl.mouse_is_locked(): if camera_tweening:
return return
if event is InputEventMouseMotion and get_charge() == 0.0 : if event is InputEventMouseMotion and MouseControl.mouse_is_locked() and get_charge() == 0.0 :
rotate_view(event.relative*sensitivity) rotate_view(event.relative*sensitivity)
if event.is_action_released("charge") and not billiard.can_hit and charge_tween != null: if event.is_action_released("charge") and not billiard.can_hit and charge_tween != null:
release() release()
if event.is_action_pressed("charge") and charge_tween == null: if event.is_action_pressed("charge") and billiard.can_hit and charge_tween == null:
if billiard.can_hit:
charge(event.get_action_strength("charge")) charge(event.get_action_strength("charge"))
else:
$NoChargesSound.play()
func _process(delta): func _process(delta):
transform.origin = target.global_position transform.origin = target.global_position
@ -45,9 +41,10 @@ func _process(delta):
if not camera_tweening: if not camera_tweening:
camera.global_transform = %camera_spot.global_transform camera.global_transform = %camera_spot.global_transform
else: else:
camera.global_position = lerp(camera.global_position, %camera_spot.global_position, 0.5) camera_tweening = false
camera.global_rotation = lerp(camera.global_rotation, %camera_spot.global_rotation, 0.5) camera.global_position = lerp(camera.global_position, %camera_spot.global_position, delta)
var epsilon: float = 0.005 camera.global_rotation = lerp(camera.global_rotation, %camera_spot.global_rotation, delta)
var epsilon: float = 0.0001
if (camera.global_position - %camera_spot.global_position).length() <= epsilon and (camera.global_rotation - %camera_spot.global_rotation).length() <= epsilon: if (camera.global_position - %camera_spot.global_position).length() <= epsilon and (camera.global_rotation - %camera_spot.global_rotation).length() <= epsilon:
camera_tweening = false camera_tweening = false

View File

@ -1,10 +1,9 @@
[gd_scene load_steps=6 format=3 uid="uid://drmb4sitb74fx"] [gd_scene load_steps=5 format=3 uid="uid://drmb4sitb74fx"]
[ext_resource type="Script" path="res://control_scheme/controller.gd" id="1_h3pjb"] [ext_resource type="Script" path="res://control_scheme/controller.gd" id="1_h3pjb"]
[ext_resource type="PackedScene" uid="uid://p2n48c8st55d" path="res://control_scheme/radial_ui.tscn" id="2_qidcb"] [ext_resource type="PackedScene" uid="uid://p2n48c8st55d" path="res://control_scheme/radial_ui.tscn" id="2_qidcb"]
[ext_resource type="AudioStream" uid="uid://ckhf7ksthi053" path="res://audio/charge.wav" id="3_exgm6"] [ext_resource type="AudioStream" uid="uid://ckhf7ksthi053" path="res://audio/charge.wav" id="3_exgm6"]
[ext_resource type="AudioStream" uid="uid://c5v6c6x05lqg3" path="res://audio/billiard-clack.wav" id="4_12r5s"] [ext_resource type="AudioStream" uid="uid://c5v6c6x05lqg3" path="res://audio/billiard-clack.wav" id="4_12r5s"]
[ext_resource type="AudioStream" uid="uid://bg07vavc0duo5" path="res://audio/error.mp3" id="5_l6rvw"]
[node name="controller" type="Node3D"] [node name="controller" type="Node3D"]
top_level = true top_level = true
@ -27,6 +26,3 @@ stream = ExtResource("3_exgm6")
[node name="ChargeReleaseSound" type="AudioStreamPlayer" parent="."] [node name="ChargeReleaseSound" type="AudioStreamPlayer" parent="."]
unique_name_in_owner = true unique_name_in_owner = true
stream = ExtResource("4_12r5s") stream = ExtResource("4_12r5s")
[node name="NoChargesSound" type="AudioStreamPlayer" parent="."]
stream = ExtResource("5_l6rvw")

View File

@ -19,9 +19,12 @@ environment = SubResource("Environment_f0m14")
transform = Transform3D(1, 0, 0, 0, 0.933762, 0.357895, 0, -0.357895, 0.933762, 0, 1.43864, 1.81738) transform = Transform3D(1, 0, 0, 0, 0.933762, 0.357895, 0, -0.357895, 0.933762, 0, 1.43864, 1.81738)
[node name="controller" parent="." index="3" node_paths=PackedStringArray("camera", "initial_target") instance=ExtResource("2_dcvuq")] [node name="controller" parent="." index="3" node_paths=PackedStringArray("camera", "initial_target") instance=ExtResource("2_dcvuq")]
camera = NodePath("../Camera3D") camera = NodePath("Camera3D")
initial_target = NodePath("../grape") initial_target = NodePath("../grape")
[node name="Camera3D" type="Camera3D" parent="controller" index="1"]
current = true
[node name="grape" parent="." index="4" instance=ExtResource("3_gijly")] [node name="grape" parent="." index="4" instance=ExtResource("3_gijly")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.56762, 0.385236) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.56762, 0.385236)
@ -29,6 +32,3 @@ transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 1.56762, 0.385236)
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.115958, 1.77839, -0.189013) transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0.115958, 1.77839, -0.189013)
[node name="TAS UI" parent="." index="6" instance=ExtResource("4_8yatx")] [node name="TAS UI" parent="." index="6" instance=ExtResource("4_8yatx")]
[node name="Camera3D" type="Camera3D" parent="." index="7"]
current = true