Jump to content

Panda.js 1.12.0 released


enpu
 Share

Recommended Posts

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});
Link to comment
Share on other sites

  • 2 weeks later...

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 main

game.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 not
game.createScene('Main', {...
But if i use the second one, all my
game.system.setScene();

don't work

Link to comment
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.

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