Compare commits
2 Commits
8ad1197406
...
a85a4e6290
| Author | SHA1 | Date | |
|---|---|---|---|
| a85a4e6290 | |||
| 76660a0336 |
@@ -108,8 +108,8 @@ Anim={
|
||||
"use_environment": false,
|
||||
"use_orthogonal": false,
|
||||
"view_type": 0,
|
||||
"x_rotation": 0.364738,
|
||||
"y_rotation": -0.731255
|
||||
"x_rotation": 1.54382,
|
||||
"y_rotation": -0.744345
|
||||
}, {
|
||||
"auto_orthogonal": false,
|
||||
"auto_orthogonal_enabled": true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[folding]
|
||||
|
||||
node_unfolds=[NodePath("."), PackedStringArray("Transform")]
|
||||
resource_unfolds=["res://assets/Weapons/Gun/Revolver.gltf::ArrayMesh_okgte", PackedStringArray()]
|
||||
resource_unfolds=["res://assets/Weapons/Gun/Revolver.gltf::ArrayMesh_7la8p", PackedStringArray()]
|
||||
nodes_folded=[NodePath("RootNode")]
|
||||
|
||||
@@ -97,7 +97,7 @@ Anim={
|
||||
"auto_orthogonal_enabled": true,
|
||||
"cinematic_preview": false,
|
||||
"display_mode": 19,
|
||||
"distance": 3.42935,
|
||||
"distance": 6.34749,
|
||||
"doppler": false,
|
||||
"frame_time": false,
|
||||
"gizmos": true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[folding]
|
||||
|
||||
node_unfolds=[NodePath("."), PackedStringArray("Transform"), NodePath("Revolver"), PackedStringArray("Transform")]
|
||||
node_unfolds=[NodePath("Revolver"), PackedStringArray("Transform")]
|
||||
resource_unfolds=[]
|
||||
nodes_folded=[]
|
||||
|
||||
@@ -8,7 +8,7 @@ dock_split_2=0
|
||||
dock_split_3=0
|
||||
dock_hsplit_1=0
|
||||
dock_hsplit_2=371
|
||||
dock_hsplit_3=-293
|
||||
dock_hsplit_3=-375
|
||||
dock_hsplit_4=0
|
||||
dock_3="Scene,Import"
|
||||
dock_4="FileSystem"
|
||||
@@ -21,7 +21,7 @@ open_scenes=["res://Game.tscn", "res://player_q3/Revolver.tscn", "res://player_q
|
||||
[ScriptEditor]
|
||||
|
||||
open_scripts=["res://Game.gd", "res://player_q3/PlayerQ3.gd", "res://player_q3/Weapon.gd", "res://player_q3/Weapons.gd"]
|
||||
open_help=[]
|
||||
open_help=["@GlobalScope"]
|
||||
script_split_offset=70
|
||||
list_split_offset=0
|
||||
|
||||
|
||||
@@ -1,29 +1,30 @@
|
||||
0b7126e0c6e86d3ec295a72f5aa6e0bd
|
||||
::res://::1669982388
|
||||
default_env.tres::Environment::-1::1669902017::0::1::::<><>::
|
||||
Game.gd::GDScript::-1::1669902945::0::1::::<>Node3D<>::
|
||||
Game.tscn::PackedScene::5276369872118157535::1669928339::0::1::::<><>::uid://c65plp2c8ms4<>res://Game.gd<>uid://bke5cip8sjpoq
|
||||
::res://assets/::1669905547
|
||||
::res://assets/Weapons/::1669906870
|
||||
::res://assets/Weapons/Bullet/::1669906883
|
||||
Bullet.gltf::PackedScene::4336956645491825573::1669906758::1669906883::1::::<><>::
|
||||
untitled.png::CompressedTexture2D::3146732503486228256::1669905562::1669905562::1::::<><>::
|
||||
untitled_DefaultMaterial_Normal.png::CompressedTexture2D::8327458012352548456::1669905562::1669905562::1::::<><>::
|
||||
::res://assets/Weapons/Gun/::1669925372
|
||||
Bob.gd::GDScript::-1::1669911667::0::1::::<>Node3D<>::
|
||||
Gun.tres::StandardMaterial3D::6195180877863663129::1669925372::0::1::::<><>::uid://670hioiwiwy0<>uid://bsfkj480gegj3
|
||||
Revolver.gltf::PackedScene::5707589478650923212::1669906933::1669907280::1::::<><>::
|
||||
Revolver_Material_Metallic.png::CompressedTexture2D::3660766575320559558::1669905562::1669907239::1::::<><>::
|
||||
untitled.png::CompressedTexture2D::2243445108492699073::1669905562::1669907107::1::::<><>::
|
||||
::res://map/::1669903737
|
||||
entity_0_worldspawn.tscn::PackedScene::3098392157343129712::1669903737::0::1::::<><>::uid://bj2qm3joiywso
|
||||
::res://player_q3/::1669928841
|
||||
PlayerQ3.gd::GDScript::-1::1669913931::0::1::::<>CharacterBody3D<>::
|
||||
PlayerQ3.tscn::PackedScene::206222296503143673::1669928339::0::1::::<><>::res://player_q3/PlayerQ3.gd<>res://player_q3/Weapons.gd<>uid://gnhgkfm3frvt
|
||||
Revolver.tscn::PackedScene::1111714730370469061::1669928339::0::1::::<><>::uid://cnk2fusin4ewy
|
||||
RevolverFix.tscn::PackedScene::448406239884148937::1669928841::0::1::::<><>::res://player_q3/Weapon.gd<>uid://p3r1q0d3ibmj
|
||||
Weapon.gd::GDScript::-1::1669925231::0::1::::Weapon<>Node3D<>::
|
||||
Weapons.gd::GDScript::-1::1669925681::0::1::::<>Node3D<>::
|
||||
::res://textures/::1669903737
|
||||
dark.png::CompressedTexture2D::3074852862410928394::1669903172::1669903737::1::::<><>::
|
||||
icon.png::CompressedTexture2D::1891077885576711950::1669902009::1669902026::1::::<><>::
|
||||
::res://::1670195986
|
||||
default_env.tres::Environment::-1::1670195011::0::1::::<><>::
|
||||
Game.gd::GDScript::-1::1670195011::0::1::::<>Node3D<>::
|
||||
Game.tscn::PackedScene::5276369872118157535::1670195011::0::1::::<><>::uid://c65plp2c8ms4<>res://Game.gd<>uid://bke5cip8sjpoq
|
||||
README.md::TextFile::-1::1670195011::0::1::::<><>::
|
||||
::res://assets/::1670195011
|
||||
::res://assets/Weapons/::1670195011
|
||||
::res://assets/Weapons/Bullet/::1670195011
|
||||
Bullet.gltf::PackedScene::4336956645491825573::1670195011::1670195988::1::::<><>::
|
||||
untitled.png::CompressedTexture2D::3146732503486228256::1670195011::1670195011::1::::<><>::
|
||||
untitled_DefaultMaterial_Normal.png::CompressedTexture2D::8327458012352548456::1670195011::1670195011::1::::<><>::
|
||||
::res://assets/Weapons/Gun/::1670195011
|
||||
Bob.gd::GDScript::-1::1670195011::0::1::::<>Node3D<>::
|
||||
Gun.tres::StandardMaterial3D::6195180877863663129::1670195011::0::1::::<><>::uid://670hioiwiwy0<>uid://bsfkj480gegj3
|
||||
Revolver.gltf::PackedScene::5707589478650923212::1670195011::1670195989::1::::<><>::uid://cui8yu4njh1td
|
||||
Revolver_Material_Metallic.png::CompressedTexture2D::3660766575320559558::1670195011::1670195011::1::::<><>::
|
||||
untitled.png::CompressedTexture2D::2243445108492699073::1670195011::1670195011::1::::<><>::
|
||||
::res://map/::1670195011
|
||||
entity_0_worldspawn.tscn::PackedScene::3098392157343129712::1670195011::0::1::::<><>::uid://bj2qm3joiywso
|
||||
::res://player_q3/::1670195011
|
||||
PlayerQ3.gd::GDScript::-1::1670195011::0::1::::<>CharacterBody3D<>::
|
||||
PlayerQ3.tscn::PackedScene::206222296503143673::1670195011::0::1::::<><>::res://player_q3/PlayerQ3.gd<>res://player_q3/Weapons.gd<>uid://gnhgkfm3frvt
|
||||
Revolver.tscn::PackedScene::1111714730370469061::1670195011::0::1::::<><>::uid://cnk2fusin4ewy
|
||||
RevolverFix.tscn::PackedScene::448406239884148937::1670195011::0::1::::<><>::res://player_q3/Weapon.gd<>uid://p3r1q0d3ibmj
|
||||
Weapon.gd::GDScript::-1::1670195011::0::1::::Weapon<>Node3D<>::
|
||||
Weapons.gd::GDScript::-1::1670195011::0::1::::<>Node3D<>::
|
||||
::res://textures/::1670195011
|
||||
dark.png::CompressedTexture2D::3074852862410928394::1670195011::1670195011::1::::<><>::
|
||||
icon.png::CompressedTexture2D::1891077885576711950::1670195011::1670195011::1::::<><>::
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
res://player_q3/RevolverFix.tscn
|
||||
res://assets/Weapons/Gun/Gun.tres
|
||||
res://Game.tscn
|
||||
res://player_q3/Weapon.gd
|
||||
res://assets/Weapons/Gun/Gun.tres
|
||||
res://player_q3/Revolver.tscn
|
||||
res://player_q3/PlayerQ3.tscn
|
||||
res://player_q3/Weapons.gd
|
||||
res://player_q3/PlayerQ3.gd
|
||||
res://player_q3/RevolverFix.tscn
|
||||
res://player_q3/Weapon.gd
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[editor_metadata]
|
||||
|
||||
executable_path="/usr/bin/godot4"
|
||||
executable_path="C:/Users/Onlyy/OneDrive/Desktop/Godot_v4.0-beta7_win64.exe"
|
||||
|
||||
[debug_options]
|
||||
|
||||
@@ -10,7 +10,7 @@ run_reload_scripts=true
|
||||
[recent_files]
|
||||
|
||||
scenes=["res://player_q3/RevolverFix.tscn", "res://player_q3/PlayerQ3.tscn", "res://player_q3/Revolver.tscn", "res://Game.tscn", "res://player_q3/revolver.tscn", "res://assets/Weapons/Gun/Revolver.gltf", "res://map/entity_0_worldspawn.tscn", "res://revolver.tscn"]
|
||||
scripts=["res://player_q3/Weapon.gd", "res://player_q3/Weapons.gd", "res://tests.gd", "res://assets/Weapons/Gun/Bob.gd", "res://Game.gd", "res://player_q3/PlayerQ3.gd", "res://README.md", "DisplayServer"]
|
||||
scripts=["@GlobalScope", "res://player_q3/Weapon.gd", "res://player_q3/Weapons.gd", "res://tests.gd", "res://assets/Weapons/Gun/Bob.gd", "res://Game.gd", "res://player_q3/PlayerQ3.gd", "res://README.md", "DisplayServer"]
|
||||
|
||||
[dialog_bounds]
|
||||
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 50,
|
||||
"column": 21,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 18,
|
||||
"row": 11,
|
||||
"scroll_position": 0.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
@@ -17,11 +17,11 @@ state={
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 40,
|
||||
"column": 29,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 51,
|
||||
"scroll_position": 52.0,
|
||||
"row": 92,
|
||||
"scroll_position": 79.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
}
|
||||
@@ -45,7 +45,7 @@ state={
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 38,
|
||||
"column": 37,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 5,
|
||||
@@ -59,11 +59,11 @@ state={
|
||||
state={
|
||||
"bookmarks": PackedInt32Array(),
|
||||
"breakpoints": PackedInt32Array(),
|
||||
"column": 2,
|
||||
"column": 22,
|
||||
"folded_lines": [],
|
||||
"h_scroll_position": 0,
|
||||
"row": 55,
|
||||
"scroll_position": 33.0,
|
||||
"row": 8,
|
||||
"scroll_position": 0.0,
|
||||
"selection": false,
|
||||
"syntax_highlighter": "GDScript"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
source_md5="82d42b8608ea72a3971e84d771d1330d"
|
||||
dest_md5="027d51cabfd57e37e343026802e1c54b"
|
||||
source_md5="63e46523b8b4e90f6f6912e03c67910b"
|
||||
dest_md5="b88afe7e7e252c3af41f8f3f6bfdd28b"
|
||||
|
||||
|
||||
Binary file not shown.
@@ -1,3 +1,3 @@
|
||||
source_md5="0b1ce2c07345d79c95da538d7344b052"
|
||||
dest_md5="9db35e6f8ff2ac3f269047287e7cb8a4"
|
||||
source_md5="09cf4d0900512c6b56838b493f8eddef"
|
||||
dest_md5="b157e1a4d9a86c391c98bc2ad29dae3b"
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -25,5 +25,6 @@ meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
import_script/path=""
|
||||
_subresources={}
|
||||
|
||||
@@ -25,6 +25,7 @@ meshes/lightmap_texel_size=0.2
|
||||
skins/use_named_skins=true
|
||||
animation/import=true
|
||||
animation/fps=30
|
||||
animation/trimming=false
|
||||
import_script/path=""
|
||||
_subresources={
|
||||
"materials": {
|
||||
|
||||
@@ -5,8 +5,10 @@
|
||||
|
||||
[node name="RevolverFix" type="Node3D"]
|
||||
script = ExtResource("1_2cfte")
|
||||
initialPos = Transform3D(0.05, 0, 0, 0, 0.05, 0, 0, 0, 0.05, 0, 0, 0)
|
||||
transition_speed = 5.0
|
||||
MOMENTUM = Vector2(-0.08, -0.25)
|
||||
ANGULAR_MOMENTUM = Vector3(-12, 7, 10)
|
||||
RECOIL_COOLDOWN = 0.35
|
||||
RPM = 600.0
|
||||
|
||||
[node name="Revolver" parent="." instance=ExtResource("1_81137")]
|
||||
transform = Transform3D(0.05, 0, 0, 0, 0.017101, -0.0469845, 0, 0.0469845, 0.017101, 0, -0.526001, -0.296439)
|
||||
|
||||
@@ -1,26 +1,35 @@
|
||||
extends Node3D
|
||||
class_name Weapon
|
||||
|
||||
const MAX_CLIP = 5
|
||||
var damage = 25
|
||||
var clip = 444444
|
||||
@export var initialPos : Transform3D
|
||||
@export var transition_speed = 1.0
|
||||
var initialTransform : Transform3D
|
||||
|
||||
|
||||
const DEFAULT = 0
|
||||
const INITIAL = 1
|
||||
const SHOOT = 2
|
||||
const RELOAD = 3
|
||||
|
||||
const DRAW_TIME = 0.35
|
||||
|
||||
#TODO: Load gun config from file
|
||||
|
||||
@export var MAX_CLIP = 5
|
||||
@export var DAMAGE = 25
|
||||
@export var MOMENTUM : Vector2
|
||||
@export var ANGULAR_MOMENTUM : Vector3
|
||||
@export var RECOIL_COOLDOWN : float
|
||||
@export var RPM: float
|
||||
var SHOOTING_SPEED: float
|
||||
var clip = 444444
|
||||
|
||||
|
||||
|
||||
|
||||
var state = DEFAULT
|
||||
|
||||
func _ready():
|
||||
SHOOTING_SPEED = 60.0 / RPM
|
||||
var tween = create_tween()
|
||||
tween.set_trans(Tween.TRANS_CIRC)
|
||||
tween.set_ease(Tween.EASE_IN_OUT)
|
||||
tween.tween_callback(InitialPos).set_delay(2)
|
||||
tween.tween_callback(InitialPos).set_delay(DRAW_TIME)
|
||||
|
||||
|
||||
func InitialPos():
|
||||
@@ -28,9 +37,9 @@ func InitialPos():
|
||||
tween.set_trans(Tween.TRANS_CIRC)
|
||||
tween.set_ease(Tween.EASE_IN_OUT)
|
||||
tween.set_parallel(true)
|
||||
tween.tween_property($Revolver, "position", initialPos.origin, 0.4)
|
||||
tween.tween_property($Revolver, "rotation", Vector3.ZERO, 0.4)
|
||||
tween.tween_callback(func(): state = INITIAL).set_delay(0.3)
|
||||
tween.tween_property($Revolver, "position", Vector3.ZERO, RECOIL_COOLDOWN / 2)
|
||||
tween.tween_property($Revolver, "rotation", Vector3.ZERO, RECOIL_COOLDOWN / 2)
|
||||
tween.tween_callback(func(): state = INITIAL).set_delay(SHOOTING_SPEED / 2)
|
||||
|
||||
|
||||
|
||||
@@ -42,14 +51,15 @@ func Shoot():
|
||||
tween.set_trans(Tween.TRANS_ELASTIC)
|
||||
tween.set_ease(Tween.EASE_OUT)
|
||||
tween.set_parallel(true)
|
||||
tween.tween_property($Revolver, "position", get_node("Revolver").transform.origin + Vector3(.0, 0.3, -.3), 0.3)
|
||||
tween.tween_property($Revolver, "rotation", Vector3(deg_to_rad(-60),.0,.0),0.3)
|
||||
tween.tween_callback(InitialPos).set_delay(0.3)
|
||||
tween.tween_property($Revolver, "position", Vector3(.0, MOMENTUM.x, MOMENTUM.y), RECOIL_COOLDOWN / 2)
|
||||
var rand_rot_y = randi_range(-ANGULAR_MOMENTUM.y,ANGULAR_MOMENTUM.y)
|
||||
var rand_rot_z = randi_range(-ANGULAR_MOMENTUM.z,ANGULAR_MOMENTUM.z)
|
||||
tween.tween_property($Revolver, "rotation", Vector3(deg_to_rad(ANGULAR_MOMENTUM.x),deg_to_rad(rand_rot_y),deg_to_rad(rand_rot_z)),RECOIL_COOLDOWN /2)
|
||||
tween.tween_callback(InitialPos).set_delay(SHOOTING_SPEED / 2)
|
||||
return true
|
||||
return false
|
||||
|
||||
|
||||
|
||||
func Reload():
|
||||
if(clip < MAX_CLIP && state == INITIAL):
|
||||
state = RELOAD
|
||||
|
||||
Reference in New Issue
Block a user