Tested some custom resources with a test scene.
This commit is contained in:
parent
4c512379c5
commit
1fd4a809f2
14 changed files with 125 additions and 4 deletions
11
scripts/EnemyResource.gd
Normal file
11
scripts/EnemyResource.gd
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
extends Resource
|
||||
class_name EnemyResource
|
||||
|
||||
var primary_enemy_bullet: BulletResource = preload("res://scripts/BulletResource.gd")
|
||||
var exploding: bool
|
||||
|
||||
@export var enemy_type: String
|
||||
@export var health: int
|
||||
@export var speed: int
|
||||
var start_pos: float
|
||||
@export var tween_speed: float
|
||||
1
scripts/EnemyResource.gd.uid
Normal file
1
scripts/EnemyResource.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://dxmlb4jyoucud
|
||||
7
scripts/ExampleResource.gd
Normal file
7
scripts/ExampleResource.gd
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
extends Resource
|
||||
class_name ExampleResource
|
||||
|
||||
@export var type: String = "Example"
|
||||
@export var speed: float = 10.0
|
||||
@export var sprite: Texture2D = preload("res://icon.svg")
|
||||
@export var new_type: bool = false
|
||||
1
scripts/ExampleResource.gd.uid
Normal file
1
scripts/ExampleResource.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://0nsrno5ksdeh
|
||||
15
scripts/bullet_stats.gd
Normal file
15
scripts/bullet_stats.gd
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
class_name BulletStats
|
||||
extends Resource
|
||||
|
||||
@export var bullet_type: String
|
||||
@export var bullet: String
|
||||
|
||||
@export var damage: int
|
||||
@export var speed: int
|
||||
|
||||
|
||||
func _init(bullet_type:String = "normal", bullet:String = "res://resources/bullet_resource.tres", damage:int = 1, speed:int = 150):
|
||||
self.bullet_type = bullet_type
|
||||
self.bullet = bullet
|
||||
self.damage = damage
|
||||
self.speed = speed
|
||||
1
scripts/bullet_stats.gd.uid
Normal file
1
scripts/bullet_stats.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://64l0xhnsdh7x
|
||||
Loading…
Add table
Add a link
Reference in a new issue