Sign in to follow this  
Followers 0
Parasyte

Debugging tips

1 post in this topic

There are a lot of things you can do to help get your questions answered faster. This announcement will provide some tips to get you unstuck as soon as possible.
The first, and most important thing to do is ALWAYS develop your game with the most recent non-minified melonJS build. Switch to the minified build for your final release; never before that point.

  • Follow the tips in the other announcement: https://groups.google.com/forum/#!topic/melonjs/SvC8ZNJ3P_c
     
  • Familiarize yourself with the debugger in your browser/user agent. You are writing a lot of JavaScript to create a full game, perhaps more than most web developers will in their entire careers. If you are not using a debugger, you are shorting yourself, and extending development time greatly.
     
    • Enable the "pause on all uncaught exceptions" feature in your debugger; this should be the first thing you configure when you open the debugger for the first time.
    • console.log() and alert() are simple to use, but breakpoints are better in every imaginable way; they are temporary, can be enabled and disabled at runtime without modifying the JavaScript, and allow you to inspect variable state at any point in the program's execution.
    • Learn to follow stack traces so you can understand how the code eventually leads up to specific events, like uncaught exceptions.
    • If your game runs slow, use the profiler in your debugger to pinpoint functions that take up the most time, and try to minimize how often the slow functions are called, or make the slow functions faster!
       
  • If you've done the above and still need a little boost in the right direction, please include the full source code for your game. It is often not enough to paste code snippets in the body of your message, because there are times when the issue lies in an area of the code you hadn't considered. We can use the techniques described above to find and solve a very wide range of issues, but only if we are able to run the code ourselves.
     
  • If you have found a true bug in the melonJS engine (not just a support request), please search the github issues for similar reports, and file a new ticket if you don't find anything: https://github.com/melonjs/melonJS/issues This is the best way to get bugs in the engine solved quickly.
     
  • If you are having trouble with the tutorial, it has its own git repository and issue tracker: https://github.com/melonjs/tutorial-platformer
     
gamify likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.