AS3 Flash/Flex DebugConsole

Software: Other

ASWC, Member
Posted: 03 April 2012 09:27 AM   Total Posts: 76

I created and been using on many games a DebugConsole class. It makes my work easier when testing games live and also provides an easy way to feed the QA guys with cheat codes. Anyway I thought I would share it if some of you are interested. It comes built-in with a Tracer class which is an extensive trace type of class. If you use it you can call dump in the console to get all your traces. You setup the DebugConsole with only one line from anywhere:

addChild(DebugConsole.getInstance()); 

You can also set it with a password for beta testing for example and also desactivate it for production.
You register all action via an helper class called ConsoleAction that way:

DebugConsole.getInstance().register(new ConsoleAction("compute"compute"Compute Numbers."21['int''String']['uint'])); 

only the first two parameters are required. A name by which to reference the action (will show in type hinting in console) then the method you want to run when called. You can pass also a description that will show when typing ‘help’ in console, number of required parameters, number of optional parameters, arrays of name types that will show when typing ‘help’ in console. I didn’t yet put the docs together but let me know what you think or what other features you think could be useful.  Of course you open the console by typing `

 

File Attachments
DebugConsole.swc  (File Size: 18KB - Downloads: 0)
   

ASWC, Member
Posted: 03 April 2012 09:33 AM   Total Posts: 76   [ # 1 ]

forgot! here is a screen shot.

 

   

Avatar
Alexander Seifert, Moderator
Posted: 03 April 2012 11:08 AM   Total Posts: 129   [ # 2 ]

Are you hosting the source code on git hub, by any chance? =)

 

 Signature 
signature_image

http://www.deltastrike.org

   

ASWC, Member
Posted: 03 April 2012 04:31 PM   Total Posts: 76   [ # 3 ]

No but I might at one point if people use it and are interested about it. First I need to finish the docs. Basically it’s all about feedback. One thing for sure it’s all free to use without restriction for anything.

 

   

Avatar
Alexander Seifert, Moderator
Posted: 04 April 2012 09:00 AM   Total Posts: 129   [ # 4 ]

The best documentation there can be is the code itself wink That is, if it is clean code, which I assume it is. You shouldn’t be afraid of confused people spamming you with support requests. The whole idea of open source code (to me) is “take it or leave it” =) Unless you want to sell it one day, then documentation comes really handy =)

 

 Signature 
signature_image

http://www.deltastrike.org

   

ASWC, Member
Posted: 04 April 2012 09:45 PM   Total Posts: 76   [ # 5 ]

I always create documentation with my classes (that is at least classes that I intend to use on many projects) cos I do need those to remember how to use my stuff (my framework is getting too big to remember everything) so I will create docs anyway. Also I do have my private svn so I’m not sure how that will work if I plug a public and second svn to it. Never done that before.

 

   

Avatar
Alexander Seifert, Moderator
Posted: 05 April 2012 06:29 AM   Total Posts: 129   [ # 6 ]

I’m just trying to talk you into putting it up on github wink
For small scale projects it’s fine not to have a documentation since the source itself should be clear enough. For bigger projects, or in the special case that you work on multiple projects at the same time, sure! Documentation is essential (unless you regularly play 8 games of chess simultaneously).
Regarding SVN > Git, dunno ... but personally, I don’t need any commit logs dating back to before I first started to work with the code wink

 

 Signature 
signature_image

http://www.deltastrike.org

   

OEGInc, Newbie
Posted: 22 April 2014 12:43 PM   Total Posts: 27   [ # 7 ]

I was just sitting down to write something almost exactly like this and I stumbled across your (very old) post.

I was hoping you had release the source to this by now, as that is a requirement for my project…

Thanks!
—Rob

 

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X