Merge branch 'master' of github.com:unfa/jam-01

This commit is contained in:
Tobiasz Karoń 2020-09-19 10:23:37 +02:00
commit a09ed4eded
9 changed files with 41 additions and 14 deletions

13
.gitignore vendored Normal file
View file

@ -0,0 +1,13 @@
# Godot-specific ignores
.import/
export.cfg
export_presets.cfg
# Imported translations (automatically generated from CSV files)
*.translation
# Mono-specific ignores
.mono/
data_*/
*.import

View file

@ -1,3 +0,0 @@
source_md5="952a962f6d20acc3a10ace9f4b0baaca"
dest_md5="b89d6940e050aef38a2c90c450d3bf94"

10
GUI/Hitmarker.gd Normal file
View file

@ -0,0 +1,10 @@
extends Control
var remaining_time = -10.0
func activate(time):
remaining_time = time
func _process(delta):
remaining_time -= delta
self.modulate = Color(1, 1, 1, exp(remaining_time * 10))

View file

@ -101,6 +101,9 @@ func join_jan():
SERVER_IP = "172.25.166.24"
initialize_client()
func set_ip(ip):
SERVER_IP = ip
func set_mouse_sensitivity(sensitivity_multiplier, save=true):
if mouse_sensitivity_multiplier != sensitivity_multiplier:
mouse_sensitivity_multiplier = sensitivity_multiplier

View file

@ -219,6 +219,7 @@ margin_right = 300.0
margin_bottom = 64.0
text = "Fullscreen"
[connection signal="pressed" from="MenuContainer/MainMenu/QuickJoin" to="." method="open_menu" binds= [ "QuickJoinMenu" ]]
[connection signal="text_changed" from="MenuContainer/MainMenu/Destination/IPAdress" to="." method="set_ip"]
[connection signal="pressed" from="MenuContainer/MainMenu/NetworkType/Host" to="." method="initialize_server"]
[connection signal="pressed" from="MenuContainer/MainMenu/NetworkType/Join" to="." method="initialize_client"]
[connection signal="pressed" from="MenuContainer/MainMenu/Options" to="." method="open_menu" binds= [ "OptionsMenu" ]]

View file

@ -4,5 +4,5 @@ var bulletHitEffect = preload("res://Assets/Effects/BulletHit.tscn")
remotesync func on_hit(damage, position):
var effect = bulletHitEffect.instance()
add_child(effect)
effect.global_transform.origin = position
get_tree().root.call_deferred("add_child", effect)

View file

@ -36,10 +36,6 @@ var walkDirInt = Vector2.ZERO
var bulletHitEffect = preload("res://Assets/Effects/BulletHit.tscn")
# Declare member variables here. Examples:
# var a = 2
# var b = "text"
func sfx_play_footsteps():
if not sfx_footsteps_play:
sfx_footsteps_play = true
@ -175,6 +171,10 @@ func shoot():
if hit.has_method("on_hit"):
hit.rpc("on_hit", 30, result.position)
if hit is get_script():
print("Is player")
$CrosshairContainer/Hitmarker.activate(.2)
func _input(event):
if str(get_tree().get_network_unique_id()) != name:

View file

@ -7,6 +7,7 @@
[ext_resource path="res://Assets/SFX/Player-Step-Concrete-04.wav" type="AudioStream" id=5]
[ext_resource path="res://Assets/SFX/Player-Step-Concrete-03.wav" type="AudioStream" id=6]
[ext_resource path="res://SoundPlayer.gd" type="Script" id=7]
[ext_resource path="res://GUI/Hitmarker.gd" type="Script" id=8]
[sub_resource type="CapsuleShape" id=1]
radius = 0.33
@ -68,7 +69,7 @@ stream = ExtResource( 6 )
stream = ExtResource( 5 )
[node name="SoundPlayer" type="Spatial" parent="Sounds"]
script = ExtResource( 7 )
script = ExtResource( 8 )
[node name="AudioStreamPlayer3D" type="AudioStreamPlayer3D" parent="Sounds/SoundPlayer"]
@ -134,13 +135,15 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="CrosshairHitConfirmation" type="Control" parent="CrosshairContainer"]
[node name="Hitmarker" type="Control" parent="CrosshairContainer"]
light_mask = -2147483647
margin_left = 512.0
margin_top = 300.0
margin_right = 512.0
margin_bottom = 300.0
script = ExtResource( 7 )
[node name="Line1" type="ColorRect" parent="CrosshairContainer/CrosshairHitConfirmation"]
[node name="Line1" type="ColorRect" parent="CrosshairContainer/Hitmarker"]
margin_left = 8.0
margin_top = -1.0
margin_right = 16.0
@ -151,7 +154,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Line2" type="ColorRect" parent="CrosshairContainer/CrosshairHitConfirmation"]
[node name="Line2" type="ColorRect" parent="CrosshairContainer/Hitmarker"]
margin_left = 8.0
margin_top = -1.0
margin_right = 16.0
@ -162,7 +165,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Line3" type="ColorRect" parent="CrosshairContainer/CrosshairHitConfirmation"]
[node name="Line3" type="ColorRect" parent="CrosshairContainer/Hitmarker"]
margin_left = 8.0
margin_top = -1.0
margin_right = 16.0
@ -173,7 +176,7 @@ __meta__ = {
"_edit_use_anchors_": false
}
[node name="Line4" type="ColorRect" parent="CrosshairContainer/CrosshairHitConfirmation"]
[node name="Line4" type="ColorRect" parent="CrosshairContainer/Hitmarker"]
margin_left = 8.0
margin_top = -1.0
margin_right = 16.0