Impact

This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact

1 decade ago by AustinP

I am receiving the following error when I try to reload Weltimeister:

The following entity classes were not loaded due to file and class name mismatches: lib/game/entities/critter.js (expected name: EntityCritter)

I assume that its a problem with my file or class names. Here are the tops of the files:

critter.js:
ig.module(
	'game.entities.critter'
)
.requires(
	'impact.entity',
	'plugins.box2d.entity'
)
.defines(function(){

ig.EntityCritter = ig.Box2DEntity.extend({

...

player.js
ig.module(
	'game.entities.player'
)
.requires(
	'impact.entity',
   'game.entities.critter'
)
.defines(function(){

EntityPlayer = ig.EntityCritter.extend({
...

and main.js
ig.module( 
	'game.main' 
)
.requires(
	'impact.game',
	'impact.font',
	
	'game.entities.player',
	'game.entities.speck',
   'game.entities.critter',
	'game.levels.thepond',
	
	'plugins.box2d.game',
   'plugins.box2d.debug',
   
   'impact.debug.debug'
)
.defines(function(){

MyGame = ig.Box2DGame.extend({
	

1 decade ago by dominic

Should be
EntityCritter = ig.Box2DEntity.extend({

not
ig.EntityCritter = ig.Box2DEntity.extend({

Small, but important difference :)

1 decade ago by AustinP

Having made that change it now gives me a slightly different error:

The following entity classes were not loaded due to file and class name mismatches: lib/game/entities/player.js (expected name: EntityPlayer)

Thanks for the help.

1 decade ago by dominic

Mhh... did you change it to
EntityPlayer = EntityCritter.extend({

instead of
EntityPlayer = ig.EntityCritter.extend({

Also check your browser's error console. Maybe there's more.

1 decade ago by AustinP

Nope. those lines appear correct.
The error console is telling me this: TypeError: ig.EntityCritter is undefined.

I could rar these files and email them to you if that would help.

1 decade ago by dominic

Please read my previous post again :)

ig.EntityCritter is undefined because you renamed it to the EntityCritter in critter.js. You can&039;t extend #ig.EntityCritter in player.js because it doesn&039;t exist anymore. It's called #EntityCritter now. Remember, you renamed it. Without the ig.

1 decade ago by AustinP

It seems I miss understood your previous post. Thank you. That appears to have fixed my problem.
One other thing, weltmeister is complaining about "this.body" being undefined in my critter.js and speck.js init functions as well as in my critter.js draw function within the ctx.rotate call.
Commenting these out it behaves correctly. I presume this is because weltmeister has no idea what to do with the box2d physics engine?

1 decade ago by dominic

Yep, you're right about that. Instead of uncommenting, you can use a conditional:
if( !ig.global.wm ) {
    // not in weltmeister
}
Page 1 of 1
« first « previous next › last »