first Prototype
This commit is contained in:
parent
89503407e7
commit
c887a2168c
78 changed files with 2494 additions and 2 deletions
14
scenes/weapon/railgun/railgun.gd
Normal file
14
scenes/weapon/railgun/railgun.gd
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
class_name Railgun extends "res://scenes/weapon/weapon.gd"
|
||||
|
||||
@onready var bullet = preload("res://scenes/bullet/bulletRailgun/bulletRailgun.tscn")
|
||||
|
||||
func attack():
|
||||
if cooldownTimer.is_stopped():
|
||||
spawnBullet()
|
||||
cooldownTimer.start(cooldown)
|
||||
|
||||
func spawnBullet():
|
||||
var newBullet = bullet.instantiate()
|
||||
newBullet.spawn(bulletPoint.global_position, get_parent().get_parent().rotation, damage, penetration)
|
||||
|
||||
get_tree().get_first_node_in_group("bulletPool").add_child(newBullet)
|
||||
1
scenes/weapon/railgun/railgun.gd.uid
Normal file
1
scenes/weapon/railgun/railgun.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dth0orslxriyp
|
||||
13
scenes/weapon/railgun/railgun.tscn
Normal file
13
scenes/weapon/railgun/railgun.tscn
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://bm2e5fwynwur8"]
|
||||
|
||||
[ext_resource type="PackedScene" uid="uid://btyuxgfn12p1y" path="res://scenes/weapon/weapon.tscn" id="1_lb4uk"]
|
||||
[ext_resource type="Script" uid="uid://dth0orslxriyp" path="res://scenes/weapon/railgun/railgun.gd" id="2_ur8td"]
|
||||
|
||||
[node name="Railgun" instance=ExtResource("1_lb4uk")]
|
||||
script = ExtResource("2_ur8td")
|
||||
damage = 10
|
||||
cooldown = 10.0
|
||||
penetration = 5
|
||||
|
||||
[node name="cooldownTimer" parent="." index="0"]
|
||||
wait_time = 10.0
|
||||
Loading…
Add table
Add a link
Reference in a new issue