Refactored unit
This commit is contained in:
@@ -76,7 +76,6 @@ resource_name = "StartButton"
|
||||
script/source = "extends TextureButton
|
||||
|
||||
const COMBAT_SCENE = preload(\"res://scenes/views/battle_view.tscn\")
|
||||
const UNIT_SCENE = preload(\"res://prefabs/unit.tscn\")
|
||||
const PLAYER_ALLEGIANCE = preload(\"res://resources/allegiance_types/player_allegiance.tres\")
|
||||
const ENEMY_ALLEGIANCE = preload(\"res://resources/allegiance_types/enemy_allegiance.tres\")
|
||||
|
||||
@@ -85,18 +84,18 @@ func _pressed() -> void:
|
||||
var combat_instance := COMBAT_SCENE.instantiate()
|
||||
var combat_map: CombatMap = combat_instance.find_child(\"CombatMap\")
|
||||
|
||||
var player_unit: Unit = UNIT_SCENE.instantiate()
|
||||
player_unit.stat_template = UnitStats.new()
|
||||
player_unit.info_template = UnitInfo.new()
|
||||
player_unit.info_template.name = \"Putit\"
|
||||
player_unit.allegiance_template = PLAYER_ALLEGIANCE
|
||||
var player_unit := Unit.new()
|
||||
player_unit.stats = UnitStats.new()
|
||||
player_unit.info = UnitInfo.new()
|
||||
player_unit.info.name = \"Putit\"
|
||||
player_unit.allegiance = PLAYER_ALLEGIANCE
|
||||
combat_map.deploy_unit(player_unit, Vector2i(3, 3))
|
||||
|
||||
var enemy_unit: Unit = UNIT_SCENE.instantiate()
|
||||
enemy_unit.stat_template = UnitStats.new()
|
||||
enemy_unit.info_template = UnitInfo.new()
|
||||
enemy_unit.info_template.name = \"Putit\"
|
||||
enemy_unit.allegiance_template = ENEMY_ALLEGIANCE
|
||||
var enemy_unit := Unit.new()
|
||||
enemy_unit.stats = UnitStats.new()
|
||||
enemy_unit.info = UnitInfo.new()
|
||||
enemy_unit.info.name = \"Putit\"
|
||||
enemy_unit.allegiance = ENEMY_ALLEGIANCE
|
||||
combat_map.deploy_unit(enemy_unit, Vector2i(6, 3))
|
||||
|
||||
var tree := get_tree()
|
||||
|
||||
Reference in New Issue
Block a user