10 years ago by davidg0
Help!
This forum is read only and just serves as an archive. If you have any questions, please post them on github.com/phoboslab/impact
Quote from Joncom
I removed your other thread because it was a duplicate of this one.
What have you tried so far?
Do you already have a LevelExit entity JavaScript file?
More details please.
ig.module( 'game.entities.levelchange' ) .requires( 'impact.entity' ) .defines(function(){ EntityLevelchange = ig.Entity.extend({ _wmDrawBox: true, _wmBoxColor: 'rgba(0, 0, 255, 0.7)', size: {x: 8, y: 8}, level: null, triggeredBy: function( entity, trigger ) { if( this.level ) { var levelName = this.level.replace(/^(Level)?(\w)(\w*)/, function( m, l, a, b ) { return a.toUpperCase() + b; }); ig.game.loadLevelDeferred( ig.global['Level'+levelName] ); } }, update: function(){} }); });
Quote from Joncom
What do you mean "doesn't work"?
Do you encounter an error message?
Are you aware of how to view the JavaScript console to look for error messages?
Are you having trouble placing the entity within weltmeister?
How do you know it doesn't work?
Tell us what you see...
ig.module( 'game.entities.levelexit' ) .requires( 'plugins.twopointfive.entity' ) .defines(function(){ EntityLevelexit = tpf.Entity.extend({ _wmDrawBox: true, _wmBoxColor: 'rgba(0, 0, 255, 0.7)', size: {x: 32, y: 32}, level: null, checkAgainst: ig.Entity.TYPE.A, update: function(){}, check: function( other ){ if(other instanceof EntityPlayer) { if( this.level ){ var levelName = this.level.replace(/^(Level)?(\w)(\w*)/, function( m, l, a, b ) { return a.toUpperCase() + b; }); ig.game.loadLevelDeferred( ig.global['Level'+levelName] ); } } } }); });