enpu Posted January 15, 2015 Share Posted January 15, 2015 Release notes:https://github.com/ekelokorpi/panda.js/releases/tag/1.12.0 Please post any questions here OttoRobba and kuk 2 Quote Link to comment Share on other sites More sharing options...
kuk Posted January 15, 2015 Share Posted January 15, 2015 thx for u work, plz update npm package Quote Link to comment Share on other sites More sharing options...
casarock Posted January 15, 2015 Share Posted January 15, 2015 Please post any questions here When I've updated collisions callback between two bodys is being fire several times. Before 1.12 is just got called once. What exactly has been changed? Is there any info where I shoudl start debugging? Or do I have to debounce the collision callback? Thanks! Quote Link to comment Share on other sites More sharing options...
enpu Posted January 15, 2015 Author Share Posted January 15, 2015 Hmm, when to bodies collide, it should only call collision once on each. Can you show your code? What was changed is that when body collides with multiple bodies on same frame, every collision gets called. Before only first one was called. Quote Link to comment Share on other sites More sharing options...
casarock Posted January 15, 2015 Share Posted January 15, 2015 Hi, here is my collision callback:collide: function(opponent) { this.randomVelocityY = this.getRandomVelocityY(); this.body.velocity.x *= -1; this.emmitParticles(16, 8); if (opponent.collisionGroup === 2) { game.scene.addScore(); }},When colide the x-velocity should be inverted. (Bounce from wall). My body definition is:this.body = new game.Body({ position: { x: x, y: y }, velocityLimit: { x: 1000, y: 1000 }, velocity: { x: this.velocityX, y: 0 }, collisionGroup: 1, collideAgainst: [0, 2], mass: 1.3 });CollisonGroup 0 body:this.body = new game.Body({ position: { x: x, y: y }, velocityLimit: { x: 150, y: 1000 }, velocity: { x: 0, y: 0 }, collisionGroup: 2, mass: 1.2});and collision group 2:this.wallBody = new game.Body({ position: { x: x + (this.wallSprite.width/2), y: y + (this.wallSprite.height/2) }, collisionGroup: 0, mass: 0}); Quote Link to comment Share on other sites More sharing options...
OttoRobba Posted January 15, 2015 Share Posted January 15, 2015 Awesome! And with plenty of time before Global Game Jam Thank you for all the hard work Enpu! Quote Link to comment Share on other sites More sharing options...
enpu Posted January 15, 2015 Author Share Posted January 15, 2015 @casarock I think you should return true on your collide function, otherwise body won't be moved, and it will collide with the wall again in next frame. Quote Link to comment Share on other sites More sharing options...
casarock Posted January 15, 2015 Share Posted January 15, 2015 @enpu: That's it! Thank you!! Quote Link to comment Share on other sites More sharing options...
Ninjadoodle Posted January 16, 2015 Share Posted January 16, 2015 Awesome! Thanks for the Panda update Quote Link to comment Share on other sites More sharing options...
martinez Posted January 16, 2015 Share Posted January 16, 2015 Thanks enpu, It would be nice if I could change gameMainModule value (eg. in config.js). After update, I had to change all my main modules names' to "game.main" to make them work. This is not a big issue, but it breaks my naming convention. Quote Link to comment Share on other sites More sharing options...
enpu Posted January 16, 2015 Author Share Posted January 16, 2015 hi @martinez I just pushed changes to core, so that it does not require 'game.main' module anymore. So you can name your game modules anything you want. Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted January 16, 2015 Share Posted January 16, 2015 Hi @enpu Is it possible to create multiply game instances in one page without iframes? The `game` object is global, looks like I can only render the game into multiply canvas Quote Link to comment Share on other sites More sharing options...
enpu Posted January 16, 2015 Author Share Posted January 16, 2015 Hi @PixelPicoSean Sorry that's not currently possible. Not sure why would you wanna run multiple games same time? Quote Link to comment Share on other sites More sharing options...
PixelPicoSean Posted January 16, 2015 Share Posted January 16, 2015 It's used in my own editor where I want to use Panda.js for both spritesheet previewing and animation editing, now only the animation editor uses Panda.It may not be that necessary Thanks for the great work btw Quote Link to comment Share on other sites More sharing options...
Earest Posted January 29, 2015 Share Posted January 29, 2015 Hi, I try to update my project to this release, but i got "TypeError: sceneClass is not a constructor" on the console log, and the asociate line is in systeme.js line 307. I think it's because I use in my maingame.module( 'game.main').require( 'engine.core', 'engine.physics', 'engine.keyboard', 'engine.debug', 'game.assets', 'game.scenes', 'game.objects').body(function() {game.start(MenuGame,window.innerWidth,window.innerHeight);});and i declare MenuGame with:MenuGame = game.Scene.extend({...and notgame.createScene('Main', {...But if i use the second one, all mygame.system.setScene();don't work Quote Link to comment Share on other sites More sharing options...
enpu Posted January 31, 2015 Author Share Posted January 31, 2015 You should not use game.start anymore. and create scenes with game.createScene('Main', {}); and change scene with game.system.setScene('Main'); You can change start scene from config:system: { startScene: 'Main'} Quote Link to comment Share on other sites More sharing options...
Earest Posted February 4, 2015 Share Posted February 4, 2015 It work perfectly, thanks a lot 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.