neonDog's Forum Posts

  • 1 posts
  • What's your thoughts on the Chipmunk physics plugin?

    I tried to edit your gravitation plug-in to work with Chipmunk physics but it doesn't have an "apply force toward" function.

    I'm guessing I'd need to calculate the the angle instead? I tried using cr.angleTo but I don't really know what I'm doing!

    The only thing that happens is every object flies off to the right of the screen

    behinstProto._apply_force_toward = function (f, px, py) {
    
        var physics_behavior_inst = this._get_physics_behavior_inst();
        var angle = cr.angleTo(this.inst.x, this.inst.y, px, py);
        cr.behaviors.rojoChipmunkBeta.prototype.acts.applyForceAt.apply(physics_behavior_inst, [1, angle, f, 0, 0, 0]);
    
    }[/code:1k0qllwp]
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • 1 posts