Created
December 17, 2018 02:50
-
-
Save manderly/ad18c768d5aa1bac4e580c8c19300aae to your computer and use it in GitHub Desktop.
Create a hero and add it to the scene
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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