Added player weapon generation from seed
This commit is contained in:
@@ -67,11 +67,11 @@ func _set_player_data(new_data: PlayerData) -> void:
|
||||
|
||||
player_data = new_data
|
||||
_weapons.clear()
|
||||
_add_weapon_by_id(player_data.first_weapon_id, weapon_positions[0])
|
||||
_add_weapon_by_id(player_data.second_weapon_id, weapon_positions[1])
|
||||
for i in range(min(player_data.weapon_ids.size(), weapon_positions.size())):
|
||||
_add_weapon_by_id(player_data.weapon_ids[i], weapon_positions[i])
|
||||
|
||||
if player_data.hull > 0:
|
||||
health.hull = mini(player_data.hull, health.max_hull)
|
||||
if player_data.is_new_game:
|
||||
health.hull = health.max_hull
|
||||
|
||||
|
||||
func _add_weapon_by_id(weapon_id: String, weapon_position: Vector2) -> void:
|
||||
|
||||
@@ -93,10 +93,10 @@ offset_top = 19.0
|
||||
offset_bottom = 19.0
|
||||
|
||||
[node name="First" type="Node2D" parent="WeaponSlots" index="0"]
|
||||
position = Vector2(-2, 8)
|
||||
position = Vector2(-2, -8)
|
||||
|
||||
[node name="Second" type="Node2D" parent="WeaponSlots" index="1"]
|
||||
position = Vector2(-2, -8)
|
||||
position = Vector2(-2, 8)
|
||||
|
||||
[node name="BlinkChargeIndicator" parent="." index="10" instance=ExtResource("5_uf2n1")]
|
||||
position = Vector2(-11, 0)
|
||||
|
||||
Reference in New Issue
Block a user