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 kurisukun

Hi, I'm not sure if this is specific to Impact++ which I am using on top of ImpactJS. However, I don't know how to modify the EntityPlayer movement speed when walking.

I tried doing the following:

.defines(function () {
    "use strict";
	
	var _c = ig.CONFIG;
	var _ut = ig.utils;
	
    ig.EntityPlayer = ig.global.EntityPlayer = ig.Player.extend({
		
		size: {x: 8, y:14},
		offset: {x: 4, y: 2},
		health: 10,
               speed: {x:50, y:50}
..

This made the player walk slower, but unable to jump anymore. Also, when changing directions, the inertia of the player makes the player keep on moving in the previous direction.

Any help would be appreciated. Thank you!

1 decade ago by kurisukun

I think I figured it out. I can tweak the speed with this:

this.maxVelGrounded = {x: 50, y: 50};
this.maxVelUngrounded = {x: 50, y: 150};
Page 1 of 1
« first « previous next › last »