rgk Posted February 7, 2016 Share Posted February 7, 2016 I currently have a game menu button that on each stage, I copy and paste the code on each stage (which sucks if I want to re position it etc...). While I'm assuming I can extend the stage object, I am not exacly sure how to go about this. Any ideas to have one piece of code for a button across multiple stages? Link to comment Share on other sites More sharing options...
AzraelTycka Posted February 7, 2016 Share Posted February 7, 2016 How about having your code in one function which is global in your game context and then calling it on every stage? That way even if you need to change the button you have only one code to adjust? Link to comment Share on other sites More sharing options...
rgk Posted February 7, 2016 Author Share Posted February 7, 2016 That worked, I should of thought of that . I didn't want to have to declare them every stage but this is definitely a better solution, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts