Hello all,
Well, I was trying to find here a topic about that and I havent succeed.
I wanted to know the right steps to convert some games to AS3.
People say that we have to refactor everything but I do know some things can be just converted directly:
E.g.
AS2: _root.Test=10;
AS3: -> (root as movieclip).Test = new int(10);
AS2: _root.mc1.mc2.gotoAndPlay(1);
AS3: (root as movieclip).mc1.mc2.gotoAndPlay(1);
AS2: key.IsDown
AS3: eventHandlers with a function.
My doubts are about:
1. Whats the best way for me to include a list of functions? I have, say, 100 functions in '_root' level.
I was creating external AS files lately, but I import them all from _root (#include file1.AS, file2.AS), so everything is based on _root yet.
How to do that in AS3? Do I have to create classes? Is there a 'root' class I can include functions for everyone? If so, is that the same classname as the main project?
I know that its good practise to create each class for each 'set' (say, a class for enemies, a class for powerups, a class for screen mechanics). But I think that, in the beginning, and in a small game, it shouldnt hurt putting them in the main class.
Its important for me to keep some code in timelines (I'm not saying those code in the instances. I dont recommend using those). Which other possible things I need to take in account when converting code inside them in order to search for variables along other movieclips?
2. Where is _global? Is there a 'global' variable instead? Thats because I use global properties like _global.LEVEL.item1,2,3,4,5, _global.GAMECONFIG.
Thank you in advance!
I really want to train myself to convert AS2 games to As3 (refactoring) the easiest (and wise) way possible, even if its still a lot of work.