mirror of
https://gitlab.com/open-fpsz/open-fpsz.git
synced 2026-07-13 07:25:06 +00:00
✅ Refactoring and added unit testing framework
This commit is contained in:
parent
06346b2d98
commit
080ce479da
145 changed files with 16250 additions and 470 deletions
|
|
@ -1,19 +1,20 @@
|
|||
extends Node3D
|
||||
class_name Projectile extends Node3D
|
||||
|
||||
const speed : float = 68.0 # m/s
|
||||
var velocity : Vector3 = Vector3.ZERO
|
||||
const lifespan : float = 5.0 # in seconds
|
||||
@export_category("Parameters")
|
||||
@export var EXPLOSION : PackedScene
|
||||
@export var speed : float = 78.4 # m/s
|
||||
@export var lifespan : float = 5.0 # in seconds
|
||||
|
||||
@onready var shape_cast = $ShapeCast3D
|
||||
@onready var game = get_tree().get_current_scene()
|
||||
|
||||
const EXPLOSION = preload("res://weapons/space_gun/projectile_explosion.tscn")
|
||||
var velocity : Vector3 = Vector3.ZERO
|
||||
|
||||
func _ready():
|
||||
var lifespan_timer = Timer.new()
|
||||
lifespan_timer.set_wait_time(lifespan)
|
||||
lifespan_timer.set_one_shot(true)
|
||||
lifespan_timer.set_autostart(true)
|
||||
lifespan_timer.wait_time = lifespan
|
||||
lifespan_timer.one_shot = true
|
||||
lifespan_timer.autostart = true
|
||||
lifespan_timer.timeout.connect(self_destruct)
|
||||
add_child(lifespan_timer)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=4 format=3 uid="uid://dn1tcakam5egs"]
|
||||
[gd_scene load_steps=5 format=3 uid="uid://dn1tcakam5egs"]
|
||||
|
||||
[ext_resource type="Script" path="res://weapons/space_gun/projectile.gd" id="1_4j1dp"]
|
||||
[ext_resource type="PackedScene" uid="uid://8atq41j7wd55" path="res://weapons/space_gun/projectile_explosion.tscn" id="2_llml6"]
|
||||
|
||||
[sub_resource type="StandardMaterial3D" id="StandardMaterial3D_o6j55"]
|
||||
albedo_color = Color(0, 0.498039, 0.854902, 1)
|
||||
|
|
@ -12,6 +13,7 @@ radius = 0.15
|
|||
|
||||
[node name="Projectile" type="Node3D"]
|
||||
script = ExtResource("1_4j1dp")
|
||||
EXPLOSION = ExtResource("2_llml6")
|
||||
|
||||
[node name="Mesh" type="CSGSphere3D" parent="."]
|
||||
transform = Transform3D(1, 0, 0, 0, 0.2, 0, 0, 0, 1, 0, 0, 0)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
extends Node3D
|
||||
class_name SpaceGun
|
||||
|
||||
const PROJECTILE = preload("res://weapons/space_gun/projectile.tscn")
|
||||
@export var PROJECTILE : PackedScene
|
||||
|
||||
@onready var nozzle = $Nozzle
|
||||
@onready var inventory = get_parent()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue