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 Jastro

Hi guys,

I want to create a flying mob, i use the property gravityFactor: 0 its ok, the mob can fly, but i have a problem i want to move to left to right, taking collisions, but this dont detect collisions.
if( !ig.game.collisionMap.getTile(
    		this.pos.x + (this.flip ? +4 : this.size.x -4),
    			this.pos.y + this.size.y+1
    		)
    	) {
    		this.flip = !this.flip;
    	}
    	var xdir = this.flip ? -1 : 1;
    	this.vel.x = this.speed * xdir;
    	this.currentAnim.flip.x = this.flip;
    	this.parent();
    },
    handleMovementTrace: function( res ) {
    	this.parent( res );
    	// collision with a wall? return!
    	if( res.collision.x ) {
    		this.flip = !this.flip;
    	}
    }

i have this, he move so crazy and when take a collision he leaves out of the level. Anyone know how can i do it?

thanks you :)

Sorry for my bad english

1 decade ago by Hareesun

You should check out the mover entity in the biolab entities pack. :)

Also, of you're asking for help, it should typically go in the Help section.
Page 1 of 1
« first « previous next › last »