refactor class names

This commit is contained in:
tonydero 2024-10-15 08:37:50 -06:00
parent fab3fe56c1
commit 9de2a0e75a
10 changed files with 15 additions and 35 deletions

View File

@ -1,12 +1,14 @@
[gd_scene load_steps=3 format=3 uid="uid://dvwo26vsk46tl"]
[ext_resource type="Script" path="res://scripts/AbilityPH.gd" id="1_6jbus"]
[ext_resource type="Texture2D" uid="uid://b10c1776j6j60" path="res://assets/icon.svg" id="1_eoss7"]
[ext_resource type="Script" path="res://scripts/AbilityPlayer.gd" id="2_l8ort"]
[node name="AbilityPH" type="TextureRect"]
offset_right = 128.0
offset_bottom = 128.0
scale = Vector2(0.5, 0.5)
texture = ExtResource("1_eoss7")
script = ExtResource("1_6jbus")
script = ExtResource("2_l8ort")
[node name="IdleCooldown" type="Timer" parent="."]
autostart = true

View File

@ -1,13 +1,13 @@
[gd_scene load_steps=4 format=3 uid="uid://55qfhbliodhn"]
[ext_resource type="Script" path="res://scripts/Enemy.gd" id="1_4u60d"]
[ext_resource type="Script" path="res://scripts/NPCEnemy.gd" id="1_ec4cy"]
[ext_resource type="Texture2D" uid="uid://b10c1776j6j60" path="res://assets/icon.svg" id="2_twdr5"]
[sub_resource type="RectangleShape2D" id="RectangleShape2D_tv6kf"]
size = Vector2(196, 175)
[node name="NPC" type="Node2D"]
script = ExtResource("1_4u60d")
[node name="NPCEnemy" type="Node2D"]
script = ExtResource("1_ec4cy")
[node name="CharacterBody2D" type="CharacterBody2D" parent="."]

View File

@ -1,5 +0,0 @@
class_name Ability
extends Sprite2D
# basis for the 6 abilities

View File

@ -1,5 +0,0 @@
class_name AbilityA1
extends Ability
# defines the unique characteristics of the A1 abilities

View File

@ -1,5 +1,5 @@
# placerholder test ability
class_name Ability
class_name AbilityPlayer
extends TextureRect
@ -12,6 +12,9 @@ var playerPos
func _ready() -> void:
middleX = get_viewport_rect().size.x/2
func _process(_delta: float) -> void:
playerPos = Vector2(middleX, get_viewport_rect().size.y*(0.75))
@ -33,10 +36,9 @@ func _get_target(enemies) -> Node:
# var numEnemies := _get_num_enemies()
var enemyDists
var closestEnemy
# get array of difficulties using map
# get list of distances by mapping distance to each node in enemies
enemyDists = enemies.map(_get_distance_to_player)
# get closest enemy by finding index with min dist
# get closest enemy by finding first index with min dist
closestEnemy = enemies[enemyDists.find(enemyDists.min())]
return closestEnemy

View File

@ -1,14 +0,0 @@
class_name Character
extends Node2D
# TODO: do the thing
@export var charName := "Character"
@export var maxHealth := 10
@export var dmgTaken := 0
func _init() -> void:
pass
#%NameLabel.text = self.charName
#%CharacterMaxHealth.text = str(self.maxHealth)
#%CharacterCurrHealth.text = str(self.maxHealth - self.dmgTaken)

View File

@ -1,4 +1,4 @@
class_name Enemy
class_name NPCEnemy
extends NPC

View File

@ -1,4 +1,4 @@
class_name Area
class_name WorldArea
extends Sprite2D

View File

@ -1,4 +1,4 @@
class_name Zone
class_name WorldZone
extends Sprite2D