feat: improved dragon walking behaviour
This commit is contained in:
parent
b4594bdd43
commit
d8419cb9a4
8 changed files with 150 additions and 66 deletions
|
@ -101,14 +101,13 @@ func _load_game():
|
|||
var hat: Texture2D = hat_outfits.get_texture(d['hat'])
|
||||
var shirt: Texture2D = shirt_outfits.get_texture(d['shirt'])
|
||||
var shoes: Texture2D = shoes_outfits.get_texture(d['shoes'])
|
||||
_pick_dragon(d['id'], d['pos'], hat, shirt, shoes, d['name'], false)
|
||||
_pick_dragon(d['id'], d['pos'], hat, shirt, shoes, false)
|
||||
print(_save_load.contents_to_save)
|
||||
|
||||
|
||||
func _instantiate_dragon_ingame(position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D, dragon_name: String, id: int) -> DragonEntity:
|
||||
var dragon: DragonEntity = dragon_ingame.instantiate()
|
||||
dragon.dress(hat, shirt, shoes)
|
||||
dragon.set_dragon_name(dragon_name)
|
||||
add_child(dragon)
|
||||
dragon.id = id
|
||||
dragon.position = position
|
||||
|
@ -118,8 +117,8 @@ func _instantiate_dragon_ingame(position: Vector2, hat: Texture2D, shirt: Textur
|
|||
return dragon
|
||||
|
||||
|
||||
func _pick_dragon(id: int, position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D, dragon_name: String, drag: bool = true):
|
||||
var dragon: Dragon = _instantiator.instantiate(position, hat, shirt, shoes, dragon_name, drag)
|
||||
func _pick_dragon(id: int, position: Vector2, hat: Texture2D, shirt: Texture2D, shoes: Texture2D, drag: bool = true):
|
||||
var dragon: Dragon = _instantiator.instantiate(position, hat, shirt, shoes, drag)
|
||||
dragon.id = id
|
||||
_dragon_entities[id] = dragon
|
||||
dragon.place_back.connect(_dragon_place_back)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue