Sign in to follow this  

Panda 2 Tips & tricks

Recommended Posts

Want to set your game window to specific size? This is great for testing your game on different resolutions and for taking screenshots.

First detach the game window to it's own window by pressing the detach button.


Then click the detach button again while pressing Shift-key down. Popup window will appear, type the size you want into the window, for example "320x480":


This will change the game window size so that the game area itself is exactly the resolution you entered (the red area):


Share this post

Link to post
Share on other sites

Create slowmotion effect easily by changing the speed of the main game timer. Keep in mind that this affects everything in the game (tweens, timers etc).

// 50% slowdown for 1 second

game.Timer.speed = 0.5; // This will slowdown everything to 50%

game.Timer.add(500, function() { // So this will take 1 second to complete
    game.Timer.speed = 1; // Back to normal speed


Share this post

Link to post
Share on other sites

If you have a repeating tween, but want to start it from a random time, just use this code after you have created your tween:

tween.currentTime = tween.duration.random();

For example, if a have a button that i want to swing from side to side using tween, but don't want it to always start from same position:

var button = new game.Sprite('button.png');
button.rotation = -0.1;

var tween = game.Tween.add(button, {
    rotation: 0.1
}, 1000, {
    repeat: Infinity,
    yoyo: true,
    easing: 'Quadratic.InOut'

tween.currentTime = tween.duration.random();


Share this post

Link to post
Share on other sites

Want to exclude some core modules from build (if you don't need them) to make the size even smaller? Specify those modules in your config like this:

game.config = {
    ignoreModules: ['engine.pool', '']

Modules that you can ignore are:

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.