-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSpell.gd
51 lines (34 loc) · 1010 Bytes
/
Spell.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class_name Projectile extends Node3D
var Shape
var Position
@onready var Scale
var velocity = Vector3.ZERO
var grav = 0
var g = Vector3.DOWN * grav
var CanMove = false
var speed = 0
@export_enum("bullet", "Ball","Wall","Area") var TypeOfProjectile: String
@export_category("Spell Stats Level")
@export_range(0, 10,1) var DamageLevel
@export_range(0, 10,1) var SpeedLevel
@export_category("Spell Stats")
var Damage = 10
var Speed = 10
# Called when the node enters the scene tree for the first time.
func _ready():
SetScale()
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
# Move the bullet to the right (adjust as needed)
velocity += delta * g
transform.origin += velocity * delta
# Remove the bullet when it goes off-screen
func SetValues():
$Area3D/CollisionShape3D.shape = Shape
func SetScale():
$".".scale.x = Scale
$".".scale.y = Scale
$".".scale.z = Scale
func _on_area_3d_body_entered(body):
print(body)
queue_free()