Jump to content

Panda 2 Tips & tricks


enpu
 Share

Recommended Posts

  • enpu pinned this topic

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.

5a5b89145c758_ScreenShot2018-01-14at18_43_17.png.09c22e4a8a66d80f984b0c3494f0e130.png

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":

5a5b893fec809_ScreenShot2018-01-14at18_43_43.png.8acc42b828774f6e7231ab1d222176de.png

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

5a5b89eeaed66_ScreenShot2018-01-14at18_48_19.png.76384dd886e09cc91d1f5dc123b91f6c.png

Link to comment
Share on other sites

  • 2 weeks later...

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
});

 

Link to comment
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'
}).start();

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

 

Link to comment
Share on other sites

  • 3 months later...
  • 2 months later...
  • 2 months later...

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', 'engine.storage']
};

Modules that you can ignore are:

engine.audio
engine.particle
engine.physics
engine.pool
engine.storage
engine.tween
 

Link to comment
Share on other sites

  • 1 month later...

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.

Guest
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.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...