Skip to content

Commit 18d212d

Browse files
first version of the shooter fork
1 parent e253041 commit 18d212d

File tree

90 files changed

+24588
-250
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

90 files changed

+24588
-250
lines changed

.gitignore

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
# Godot 4+ specific ignores
22
.godot/
3+
.nomedia
34

4-
# Common
5-
.DS_Store
5+
# Godot-specific ignores
6+
.import/
7+
export.cfg
8+
export_credentials.cfg
9+
*.tmp
610

11+
# Imported translations (automatically generated from CSV files)
12+
*.translation
13+
14+
# Mono-specific ignores
15+
.mono/
16+
data_*/
17+
mono_crash.*.json

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ Before you submit your pull request, though, I would kindly ask you to revisit y
2525

2626
Therefore, I would again kindly ask you to stick to the following stylistic choices:
2727
- Use `4 spaces` instead of tabs
28-
- When you submit your PR, if it shows a lot more changes than what you thought there would be, this is most likely the cause as your editor might be changing the indentations in changed lines automatically
29-
- To fix individual files or lines without changing your editor settings, you can simply select the lines with tabs instead of spaces, and hit `Ctrl+i` (`Cmd+i` on Mac) to convert the indetations to spaces
28+
- When you submit your PR, if it shows a lot more changes than what you thought there would be, this is most likely the cause as your editor might be changing the indentations in changed lines automatically
29+
- To fix individual files or lines without changing your editor settings, you can simply select the lines with tabs instead of spaces, and hit `Ctrl+i` (`Cmd+i` on Mac) to convert the indetations to spaces
3030
- Don't over-comment the code. Most of the existing code admittedly have a lot of comments but that wasn't a good decision
3131
- Name your variables, classes and files according to the [Naming Conventions](#Naming_Conventions)
3232
- Always add type hints to exported and/or public class/script fields even if it's obvious (e.g. `@export var move_speed: float = 1.0` instead of `@export var move_speed = 1.0`)

CREDITS.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Credits
2+
3+
Credits to the original project, it was an awesome project.
4+
5+
## Shooter
6+
7+
Some of the design is inspired by [Johnny Rouddro's tutorial series](https://www.youtube.com/watch?v=DPTsTr9Fi_Q&list=PLqbBeBobXe08DLRMDMyY2YXLx-Q4R9Ujl&index=1), his code is available on [Github](https://github.com/JohnnyRouddro/Godot_Third_Person_Shooter) under the MIT license.
8+
9+
The icons are provided by [game-icons.net](https://game-icons.net/) under the CC BY 3.0 license.
10+
Links to the original providers and credits:
11+
- [glock icon](https://game-icons.net/1x1/john-colburn/pistol-gun.html)
12+
- [revolver icon](https://game-icons.net/1x1/skoll/revolver.html)
13+
- [fist icon](https://game-icons.net/1x1/john-redman/rock.html)
14+
15+
The animations, new model and weapons were provided by [quaternius.com](https://quaternius.com/) under the CC0 license.
16+
17+
The energy field effect for the loots was provided by [godotshaders.com](https://godotshaders.com/shader/simple-energy-shield/) under the CC0 license.
18+
19+
The Bungee font used was provided under the SIL OPEN FONT LICENSE.
20+
21+
The pistol reload sound was provided by [MaximBomba](https://freesound.org/people/MaximBomba/sounds/432139/) under the CC0 license.
22+
23+
The gunshot sounds were provided by [rubberduck](https://opengameart.org/content/25-cc0-bang-firework-sfx) under the CC0 license.

Main.tscn

Lines changed: 68 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
1-
[gd_scene load_steps=13 format=3 uid="uid://duugmnauemcc7"]
1+
[gd_scene load_steps=25 format=3 uid="uid://duugmnauemcc7"]
22

33
[ext_resource type="PackedScene" uid="uid://c0vnqt6uyxaoa" path="res://player/Player.tscn" id="1"]
4+
[ext_resource type="Script" uid="uid://cn2j8ijo5la1w" path="res://MainScene.gd" id="1_20pc6"]
45
[ext_resource type="Material" uid="uid://cb6br3g0cy6c1" path="res://assets/materials/Grass.tres" id="1_ugafu"]
56
[ext_resource type="Material" uid="uid://c560kh0cq42t2" path="res://assets/materials/Concrete.tres" id="2_4xuie"]
67
[ext_resource type="Material" uid="uid://cotjsbb4imdui" path="res://assets/materials/Wood.tres" id="3_tqk2n"]
78
[ext_resource type="Texture2D" uid="uid://btrceayvxka1y" path="res://assets/textures/dirt256x256.png" id="4_54p8n"]
9+
[ext_resource type="PackedScene" uid="uid://cu8sxhbwx8es6" path="res://ui/GunHUD.tscn" id="6_3dxm6"]
10+
[ext_resource type="Script" uid="uid://cmgy6q26hxec" path="res://ui/GUI.gd" id="7_5vvyt"]
11+
[ext_resource type="Script" uid="uid://bjhndfs2qk583" path="res://scripts/ThirdPersonControllerEventBus.gd" id="7_lgr22"]
12+
[ext_resource type="Script" uid="uid://dyfxhxgpjuulb" path="res://weapons/WeaponDropContainer.gd" id="8_03owx"]
13+
[ext_resource type="FontFile" uid="uid://iq1865kgwkev" path="res://assets/Fonts/Bungee/Bungee-Regular.ttf" id="8_5vvyt"]
14+
[ext_resource type="PackedScene" uid="uid://b432p6oj3ys6v" path="res://weapons/WeaponDrop.tscn" id="8_trn2v"]
15+
[ext_resource type="Script" uid="uid://vmrj2qeky63q" path="res://weapons/WeaponItem.gd" id="13_c2ibq"]
16+
[ext_resource type="Resource" uid="uid://b55xhpttah1lq" path="res://weapons/resources/revolver_weapon_resource.tres" id="14_j4qnp"]
17+
[ext_resource type="Resource" uid="uid://7iuj6150gurm" path="res://weapons/resources/glock_weapon_resource.tres" id="15_j4qnp"]
818

919
[sub_resource type="ProceduralSkyMaterial" id="ProceduralSkyMaterial_ukb2j"]
1020

@@ -31,7 +41,48 @@ size = Vector3(25, 11, 19)
3141
[sub_resource type="BoxShape3D" id="8"]
3242
size = Vector3(25.7228, 10, 17.671)
3343

44+
[sub_resource type="Resource" id="Resource_fpfj3"]
45+
script = ExtResource("13_c2ibq")
46+
current_mag = 20
47+
weapon = ExtResource("14_j4qnp")
48+
metadata/_custom_type_script = "uid://vmrj2qeky63q"
49+
50+
[sub_resource type="Resource" id="Resource_sc1dx"]
51+
script = ExtResource("13_c2ibq")
52+
current_mag = 20
53+
weapon = ExtResource("15_j4qnp")
54+
metadata/_custom_type_script = "uid://vmrj2qeky63q"
55+
3456
[node name="Main" type="Node3D"]
57+
script = ExtResource("1_20pc6")
58+
59+
[node name="ThirdPersonControllerEventBus" type="Node" parent="."]
60+
script = ExtResource("7_lgr22")
61+
62+
[node name="CanvasLayer" type="CanvasLayer" parent="."]
63+
script = ExtResource("7_5vvyt")
64+
65+
[node name="GunHud" parent="CanvasLayer" instance=ExtResource("6_3dxm6")]
66+
67+
[node name="PickWeaponButtonParent" type="Control" parent="CanvasLayer"]
68+
layout_mode = 3
69+
anchors_preset = 7
70+
anchor_left = 0.5
71+
anchor_top = 1.0
72+
anchor_right = 0.5
73+
anchor_bottom = 1.0
74+
offset_left = -20.0
75+
offset_top = -40.0
76+
offset_right = 20.0
77+
grow_horizontal = 2
78+
grow_vertical = 0
79+
80+
[node name="PickupWeaponButton" type="Button" parent="CanvasLayer/PickWeaponButtonParent"]
81+
layout_mode = 0
82+
offset_right = 8.0
83+
offset_bottom = 8.0
84+
theme_override_fonts/font = ExtResource("8_5vvyt")
85+
text = "Pick up"
3586

3687
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
3788
environment = SubResource("2")
@@ -91,3 +142,19 @@ skeleton = NodePath("../..")
91142

92143
[node name="CollisionShape3D" type="CollisionShape3D" parent="Water"]
93144
shape = SubResource("8")
145+
146+
[node name="WeaponDropContainer" type="Node3D" parent="."]
147+
script = ExtResource("8_03owx")
148+
149+
[node name="WeaponDrop" parent="WeaponDropContainer" instance=ExtResource("8_trn2v")]
150+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, 0)
151+
weapon_item = SubResource("Resource_fpfj3")
152+
153+
[node name="WeaponDrop2" parent="WeaponDropContainer" instance=ExtResource("8_trn2v")]
154+
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -1, 1, -11.4024)
155+
weapon_item = SubResource("Resource_sc1dx")
156+
auto_loot = true
157+
158+
[connection signal="button_up" from="CanvasLayer/PickWeaponButtonParent/PickupWeaponButton" to="." method="_on_pickup_weapon_button_button_up"]
159+
[connection signal="player_entered_weapon_drop" from="WeaponDropContainer" to="." method="_on_weapon_drop_container_player_entered_weapon_drop"]
160+
[connection signal="player_exited_weapon_drop" from="WeaponDropContainer" to="." method="_on_weapon_drop_container_player_exited_weapon_drop"]

MainScene.gd

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
extends Node3D
2+
3+
@onready var third_person_controller_event_bus: ThirdPersonControllerEventBus = $ThirdPersonControllerEventBus
4+
5+
@onready var pick_weapon_button_parent: Control = $CanvasLayer/PickWeaponButtonParent
6+
7+
var current_weapon_drop: WeaponDrop
8+
9+
func _ready() -> void:
10+
pick_weapon_button_parent.hide()
11+
12+
func _on_weapon_drop_container_player_entered_weapon_drop(weapon_drop: WeaponDrop) -> void:
13+
current_weapon_drop = weapon_drop
14+
pick_weapon_button_parent.show()
15+
16+
# we are sending the event manually as ane example
17+
third_person_controller_event_bus.send_player_entered_weapon_drop.emit(
18+
weapon_drop
19+
)
20+
21+
func _on_weapon_drop_container_player_exited_weapon_drop(weapon_drop: WeaponDrop) -> void:
22+
current_weapon_drop = null
23+
pick_weapon_button_parent.hide()
24+
25+
# we are sending the event manually as ane example
26+
third_person_controller_event_bus.send_player_exited_weapon_drop.emit(
27+
weapon_drop
28+
)
29+
30+
func _on_pickup_weapon_button_button_up() -> void:
31+
# it cant happen because of the third person view
32+
pass

MainScene.gd.uid

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
uid://cn2j8ijo5la1w
115 KB
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[remap]
2+
3+
importer="font_data_dynamic"
4+
type="FontFile"
5+
uid="uid://iq1865kgwkev"
6+
path="res://.godot/imported/Bungee-Regular.ttf-5bee3d0ebbe5bc3843f41e8eaf33f2bc.fontdata"
7+
8+
[deps]
9+
10+
source_file="res://assets/Fonts/Bungee/Bungee-Regular.ttf"
11+
dest_files=["res://.godot/imported/Bungee-Regular.ttf-5bee3d0ebbe5bc3843f41e8eaf33f2bc.fontdata"]
12+
13+
[params]
14+
15+
Rendering=null
16+
antialiasing=1
17+
generate_mipmaps=false
18+
disable_embedded_bitmaps=true
19+
multichannel_signed_distance_field=false
20+
msdf_pixel_range=8
21+
msdf_size=48
22+
allow_system_fallback=true
23+
force_autohinter=false
24+
hinting=1
25+
subpixel_positioning=4
26+
keep_rounding_remainders=true
27+
oversampling=0.0
28+
Fallbacks=null
29+
fallbacks=[]
30+
Compress=null
31+
compress=true
32+
preload=[]
33+
language_support={}
34+
script_support={}
35+
opentype_features={}

assets/Fonts/Bungee/OFL.txt

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
Copyright 2023 The Bungee Project Authors (https://github.com/djrrb/Bungee)
2+
3+
This Font Software is licensed under the SIL Open Font License, Version 1.1.
4+
This license is copied below, and is also available with a FAQ at:
5+
https://openfontlicense.org
6+
7+
8+
-----------------------------------------------------------
9+
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10+
-----------------------------------------------------------
11+
12+
PREAMBLE
13+
The goals of the Open Font License (OFL) are to stimulate worldwide
14+
development of collaborative font projects, to support the font creation
15+
efforts of academic and linguistic communities, and to provide a free and
16+
open framework in which fonts may be shared and improved in partnership
17+
with others.
18+
19+
The OFL allows the licensed fonts to be used, studied, modified and
20+
redistributed freely as long as they are not sold by themselves. The
21+
fonts, including any derivative works, can be bundled, embedded,
22+
redistributed and/or sold with any software provided that any reserved
23+
names are not used by derivative works. The fonts and derivatives,
24+
however, cannot be released under any other type of license. The
25+
requirement for fonts to remain under this license does not apply
26+
to any document created using the fonts or their derivatives.
27+
28+
DEFINITIONS
29+
"Font Software" refers to the set of files released by the Copyright
30+
Holder(s) under this license and clearly marked as such. This may
31+
include source files, build scripts and documentation.
32+
33+
"Reserved Font Name" refers to any names specified as such after the
34+
copyright statement(s).
35+
36+
"Original Version" refers to the collection of Font Software components as
37+
distributed by the Copyright Holder(s).
38+
39+
"Modified Version" refers to any derivative made by adding to, deleting,
40+
or substituting -- in part or in whole -- any of the components of the
41+
Original Version, by changing formats or by porting the Font Software to a
42+
new environment.
43+
44+
"Author" refers to any designer, engineer, programmer, technical
45+
writer or other person who contributed to the Font Software.
46+
47+
PERMISSION & CONDITIONS
48+
Permission is hereby granted, free of charge, to any person obtaining
49+
a copy of the Font Software, to use, study, copy, merge, embed, modify,
50+
redistribute, and sell modified and unmodified copies of the Font
51+
Software, subject to the following conditions:
52+
53+
1) Neither the Font Software nor any of its individual components,
54+
in Original or Modified Versions, may be sold by itself.
55+
56+
2) Original or Modified Versions of the Font Software may be bundled,
57+
redistributed and/or sold with any software, provided that each copy
58+
contains the above copyright notice and this license. These can be
59+
included either as stand-alone text files, human-readable headers or
60+
in the appropriate machine-readable metadata fields within text or
61+
binary files as long as those fields can be easily viewed by the user.
62+
63+
3) No Modified Version of the Font Software may use the Reserved Font
64+
Name(s) unless explicit written permission is granted by the corresponding
65+
Copyright Holder. This restriction only applies to the primary font name as
66+
presented to the users.
67+
68+
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69+
Software shall not be used to promote, endorse or advertise any
70+
Modified Version, except to acknowledge the contribution(s) of the
71+
Copyright Holder(s) and the Author(s) or with their explicit written
72+
permission.
73+
74+
5) The Font Software, modified or unmodified, in part or in whole,
75+
must be distributed entirely under this license, and must not be
76+
distributed under any other license. The requirement for fonts to
77+
remain under this license does not apply to any document created
78+
using the Font Software.
79+
80+
TERMINATION
81+
This license becomes null and void if any of the above conditions are
82+
not met.
83+
84+
DISCLAIMER
85+
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88+
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89+
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90+
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91+
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92+
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93+
OTHER DEALINGS IN THE FONT SOFTWARE.
36.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)