Merge branch 'master' of ssh://play.qtechofficial.com:9940/funnymemellama/funnymemellama

This commit is contained in:
Thomas Muller 2023-10-02 00:38:08 -04:00
commit 6283e41488
8 changed files with 41 additions and 78 deletions

View file

@ -50,7 +50,7 @@ func interact(other):
if _triggered:
return
_triggered = true
triggered.emit(other)
_sound.stream = press_sound
_sound.play()
@ -63,7 +63,7 @@ func _on_anim_finished(name):
_button.material = released_material
_resetting = false
_triggered = false
if momentary and _triggered:
_sound.stop()
_sound.stream = release_sound

View file

@ -30,7 +30,7 @@ func _ready():
func _physics_process(delta):
# Shamelessly stolen code from quake :)
var fmove = 0.0
var smove = 0.0
var upmove = 0.0
@ -48,26 +48,26 @@ func _physics_process(delta):
if Input.is_action_pressed("run"):
fmove *= 2.0
smove *= 2.0
var wishvel = Vector3()
var cam_xform: Transform3D = camera.get_global_transform()
var cam_basis: Basis = cam_xform.basis
wishvel = cam_basis.z * fmove + cam_basis.x * smove
if _noclip:
wishvel.y += upmove
var wishdir = wishvel.normalized()
var wishspeed = wishvel.length()
if wishspeed > MAX_SPEED:
wishvel *= MAX_SPEED / wishspeed
wishspeed = MAX_SPEED
if Input.is_action_pressed("jump") and is_on_floor():
velocity.y += JUMP_SPEED
var vel = velocity
if _noclip:
vel = wishvel
@ -76,65 +76,65 @@ func _physics_process(delta):
vel = _apply_accel(vel, wishdir, wishspeed, delta)
else:
vel = _apply_air_accel(vel, wishvel, delta)
if not _noclip:
vel.y += g * delta
velocity = vel
move_and_slide()
$Ball.global_position = camera.global_position - camera.global_transform.basis.z * 2.0
func _apply_friction(vel: Vector3, delta: float):
var speed = sqrt(vel.x ** 2 + vel.z ** 2)
if(speed == 0.0): return vel
# TODO: edge detect friction?
var friction = FRICTION
var control = 0.0
if speed < STOP_SPEED:
control = STOP_SPEED
else:
control = speed
var newspeed = speed - delta * control * friction
if newspeed < 0.0:
newspeed = 0.0
else:
newspeed /= speed
return vel * newspeed
func _apply_accel(vel: Vector3, wishdir: Vector3, wishspeed: float, delta: float):
var currentspeed = vel.dot(wishdir)
var addspeed = wishspeed - currentspeed
if addspeed <= 0.0:
return vel
var accelspeed = ACCEL * delta * wishspeed
if accelspeed > addspeed:
accelspeed = addspeed
return vel + accelspeed * wishdir
func _apply_air_accel(vel: Vector3, wishvel: Vector3, delta: float):
var wishveloc = wishvel.normalized()
var wishspd = wishvel.length()
if wishspd > MAX_AIR_SPEED:
wishspd = MAX_AIR_SPEED
var currentspeed = vel.dot(wishveloc)
var addspeed = wishspd - currentspeed
if addspeed <= 0:
return vel
var accelspeed = AIR_ACCEL * wishspd * delta
if accelspeed > addspeed:
accelspeed = addspeed
return vel + accelspeed * wishveloc
func _input(event):
@ -144,22 +144,22 @@ func _input(event):
Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE)
else:
Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED)
if _paused: return
if event.is_action_pressed('noclip'):
_noclip = not _noclip
if _noclip:
$CollisionShape3D.disabled = true
else:
$CollisionShape3D.disabled = false
# Check for mouse motion input
if event is InputEventMouseMotion:
rotation.y += -event.relative.x * 0.005
camera.rotation.x += -event.relative.y * 0.005
camera.rotation.x = clamp(camera.rotation.x, deg_to_rad(-70), deg_to_rad(70))
if event.is_action_pressed("interact"):
var space_state = get_world_3d().direct_space_state
# use global coordinates, not local to node
@ -171,4 +171,4 @@ func _input(event):
var other: Node3D = result.collider
if other.has_method('interact'):
other.interact(self)

View file

@ -1,19 +0,0 @@
[remap]
importer="mp3"
type="AudioStreamMP3"
uid="uid://7s6wb487kv2d"
path="res://.godot/imported/bomb-has-been-defused-csgo-sound-effect.mp3-332b53da130915533f660c596948e2ca.mp3str"
[deps]
source_file="res://bomb-has-been-defused-csgo-sound-effect.mp3"
dest_files=["res://.godot/imported/bomb-has-been-defused-csgo-sound-effect.mp3-332b53da130915533f660c596948e2ca.mp3str"]
[params]
loop=false
loop_offset=0
bpm=0
beat_count=0
bar_beats=4

View file

@ -1,11 +1,12 @@
[gd_scene load_steps=11 format=3 uid="uid://bp1fooevcl4lk"]
[gd_scene load_steps=12 format=3 uid="uid://bp1fooevcl4lk"]
[ext_resource type="ArrayMesh" uid="uid://cfm21e1rmsbvt" path="res://assets/maps/devworld.obj" id="1_67d5q"]
[ext_resource type="PackedScene" uid="uid://wl1n3y8mcq0x" path="res://Commentary.tscn" id="2_3gk04"]
[ext_resource type="AudioStream" uid="uid://d100ilqihkimr" path="res://whatareyouwatchingbro.mp3" id="3_qy4vp"]
[ext_resource type="AudioStream" uid="uid://7s6wb487kv2d" path="res://bomb-has-been-defused-csgo-sound-effect.mp3" id="3_sy6mw"]
[ext_resource type="AudioStream" uid="uid://blhm5fmqxxyjb" path="res://assets/sounds/commentarynodes/this_is_an_other_commentary_node.ogg" id="3_57rk3"]
[ext_resource type="AudioStream" uid="uid://eycsn6ww81e3" path="res://assets/sounds/commentarynodes/thisisacommentarynode.ogg" id="4_qboc2"]
[ext_resource type="PackedScene" uid="uid://ce7nfed54mwps" path="res://Button.tscn" id="5_57sxr"]
[ext_resource type="PackedScene" uid="uid://cp4rwojl3c3y3" path="res://test.tscn" id="6_8wwor"]
[ext_resource type="AudioStream" uid="uid://kbklqaa8yx0s" path="res://assets/sounds/button/buttonin01.ogg" id="6_dw4i0"]
[ext_resource type="PackedScene" uid="uid://cjn7bvtws2uip" path="res://Door.tscn" id="7_0wker"]
[sub_resource type="ConcavePolygonShape3D" id="ConcavePolygonShape3D_fwixm"]
@ -29,14 +30,14 @@ shape = SubResource("ConcavePolygonShape3D_fwixm")
[node name="Commentary" parent="." instance=ExtResource("2_3gk04")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.125, -0.25, 0.496153)
sound = ExtResource("3_sy6mw")
sound = ExtResource("3_57rk3")
volume = -20.0
capture_radius = 5.0
low_speed = 2.0
[node name="Commentary2" parent="." instance=ExtResource("2_3gk04")]
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -3.06073, -0.25, 3.2)
sound = ExtResource("3_qy4vp")
sound = ExtResource("4_qboc2")
volume = -30.0
[node name="Button" parent="." instance=ExtResource("5_57sxr")]
@ -44,7 +45,7 @@ transform = Transform3D(-4.37114e-08, 0, 1, 0, 1, 0, -1, 0, -4.37114e-08, -20.48
momentary = true
released_material = SubResource("StandardMaterial3D_pr3ys")
pressed_material = SubResource("StandardMaterial3D_tselo")
sound = ExtResource("3_sy6mw")
sound = ExtResource("6_dw4i0")
volume = -10.0
[node name="CardboardKreb" parent="." instance=ExtResource("6_8wwor")]

File diff suppressed because one or more lines are too long

Binary file not shown.

View file

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