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

9 years ago by capgun

Hi guys, I've been following the 'getting started' tutorials over at http://collinhover.github.io/impactplusplus/tutorial-Player.html

I'm trying to increase my projectile velocity to something larger than 200 but I can't seem to get my projectile moving any faster.

I've also set my user.config to:

ig.CONFIG_USER = {
    ENTITY: {
        MAX_VEL_X: 1200
    }
}

This isn't achieving the desired result. Any help would be greatly appreciated, i'm seriously pulling my hair out over this one.

9 years ago by Joncom

Not sure how to solve this in Impact++.
However here's how you'd do it in vanilla Impact:

ig.module('game.entities.example')
.requires('impact.entity')
.defines(function() {

    EntityExample = ig.Entity.extend({
        maxVel: { x: 9999, y: 9999 },
        ...

        init: function(x, y, settings) {
            this.parent(x, y, settings);
            ...
        },

        update: function() {
            this.parent();
            ...
        }
    });
});

9 years ago by RockLeo

In addition to what Joncom said you have to set vel: {x: XXX,y: XXX} too.
Page 1 of 1
« first « previous next › last »