Skip to content

Instantly share code, notes, and snippets.

@manderly
Created December 17, 2018 02:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manderly/ad18c768d5aa1bac4e580c8c19300aae to your computer and use it in GitHub Desktop.
Save manderly/ad18c768d5aa1bac4e580c8c19300aae to your computer and use it in GitHub Desktop.
Create a hero and add it to the scene
#the new hero is the last thing in the roster, so grab it out of the back
var lastIndex = global.guildRoster.size() - 1
global.selectedHero = global.guildRoster[lastIndex]
var heroScene = preload("res://hero.tscn").instance()
heroScene.set_instance_data(global.selectedHero)
heroScene._draw_sprites()
heroScene.set_position(Vector2(240, 80)) #screen is 540 wide
heroScene.set_display_params(false, true) #walking enabled?, show name
add_child(heroScene)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment