enpu Posted January 2, 2018 Share Posted January 2, 2018 I will be posting here some tips and tricks for Panda 2. Here is first. If you want to create class that doesn't show up in the sidebar you can do it like this: game.Player = game.Class.extend({ init: function() { } }); Karnage and Ninjadoodle 2 Quote Link to comment Share on other sites More sharing options...
enpu Posted January 2, 2018 Author Share Posted January 2, 2018 If you need to check what version of plugin are you using, type this into JavaScript console: game.modules['plugin.three'].version Example: Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
enpu Posted January 14, 2018 Author Share Posted January 14, 2018 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): Ninjadoodle and pstrejczek 2 Quote Link to comment Share on other sites More sharing options...
enpu Posted January 24, 2018 Author Share Posted January 24, 2018 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 }); Ninjadoodle and momenimum 2 Quote Link to comment Share on other sites More sharing options...
enpu Posted January 26, 2018 Author Share Posted January 26, 2018 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(); Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
enpu Posted January 29, 2018 Author Share Posted January 29, 2018 Play sound effect with slightly random pitch, so it doesn't sound exactly same every time: var sound = new game.Sound('jump.m4a'); sound.rate = Math.random(0.9, 1.1); sound.play(); Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
enpu Posted May 8, 2018 Author Share Posted May 8, 2018 Shift-click project in the Projects list to open the project folder in Finder / Explorer. Ninjadoodle 1 Quote Link to comment Share on other sites More sharing options...
enpu Posted July 23, 2018 Author Share Posted July 23, 2018 By default, all audio is stopped when you change scene. Want to disable that? Add this to your config: audio: { stopOnSceneChange: false } Ninjadoodle, Wolfsbane and momenimum 3 Quote Link to comment Share on other sites More sharing options...
enpu Posted September 27, 2018 Author Share Posted September 27, 2018 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 Wolfsbane 1 Quote Link to comment Share on other sites More sharing options...
enpu Posted November 22, 2018 Author Share Posted November 22, 2018 How to display icons in your projects list instead of screenshot? Just place icon.png file in the root of your project. Optimal size is 120x120. Wolfsbane and greencoder 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.