decreased velocities on map #2150
This commit is contained in:
parent
7fb5244d1c
commit
8c126fbe26
@ -489,7 +489,9 @@ export default {
|
|||||||
Matter.Body.setPosition(this.body, this.pos);
|
Matter.Body.setPosition(this.body, this.pos);
|
||||||
|
|
||||||
// add init velocity
|
// add init velocity
|
||||||
this.setInitBodyVelocity()
|
// INFO no need of init velocity as each mapitems are repeling the each others
|
||||||
|
// this.setInitBodyVelocity()
|
||||||
|
|
||||||
// console.log('concernementItem mass', this.body.mass);
|
// console.log('concernementItem mass', this.body.mass);
|
||||||
Matter.Composite.add(this.matterEngine.world, this.body);
|
Matter.Composite.add(this.matterEngine.world, this.body);
|
||||||
// console.log('concernement body', this.body);
|
// console.log('concernement body', this.body);
|
||||||
@ -500,7 +502,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
setInitBodyVelocity(){
|
setInitBodyVelocity(){
|
||||||
let delta = 50;
|
let delta = 5;
|
||||||
Matter.Body.setVelocity(this.body, {
|
Matter.Body.setVelocity(this.body, {
|
||||||
x: -delta + Math.random()*delta*2,
|
x: -delta + Math.random()*delta*2,
|
||||||
y: -delta + Math.random()*delta*2
|
y: -delta + Math.random()*delta*2
|
||||||
@ -1883,10 +1885,10 @@ export default {
|
|||||||
? this.canvas.width - pseudo_center_x
|
? this.canvas.width - pseudo_center_x
|
||||||
: pseudo_center_x;
|
: pseudo_center_x;
|
||||||
|
|
||||||
// X force decrsinsing near the center
|
// X force decreasing near the center
|
||||||
// max and min force
|
// max and min force
|
||||||
let xminf = 0;
|
let xminf = 0;
|
||||||
let xmaxf = 1 + Math.random()*4;
|
let xmaxf = 1;// + Math.random()*4;
|
||||||
// scale factor
|
// scale factor
|
||||||
let xscale = (xmaxf-xminf) / (maxp-minp);
|
let xscale = (xmaxf-xminf) / (maxp-minp);
|
||||||
let x_force = Math.exp(xminf + xscale*(dist-minp)) * dir;
|
let x_force = Math.exp(xminf + xscale*(dist-minp)) * dir;
|
||||||
@ -1904,7 +1906,7 @@ export default {
|
|||||||
|
|
||||||
// Friction air fa (increasing near the center)
|
// Friction air fa (increasing near the center)
|
||||||
let fa_minf = 0;
|
let fa_minf = 0;
|
||||||
let fa_maxf = 6;
|
let fa_maxf = 20;
|
||||||
// scale factor
|
// scale factor
|
||||||
let fa_scale = (fa_maxf-fa_minf) / (maxp-minp);
|
let fa_scale = (fa_maxf-fa_minf) / (maxp-minp);
|
||||||
let fa = Math.exp(fa_minf + fa_scale*(dist-minp)*-1);
|
let fa = Math.exp(fa_minf + fa_scale*(dist-minp)*-1);
|
||||||
@ -1960,7 +1962,8 @@ export default {
|
|||||||
|
|
||||||
// X max and min force
|
// X max and min force
|
||||||
let xminf = 0;
|
let xminf = 0;
|
||||||
let xmaxf = 4 + Math.random()*3;
|
// let xmaxf = 4 + Math.random()*3;
|
||||||
|
let xmaxf = 2 + Math.random()*2;
|
||||||
// scale factor
|
// scale factor
|
||||||
let xscale = (xmaxf-xminf) / (maxp-minp);
|
let xscale = (xmaxf-xminf) / (maxp-minp);
|
||||||
|
|
||||||
@ -1970,7 +1973,8 @@ export default {
|
|||||||
// y_velocity = Math.random() > 0.5 ? -y_velocity : y_velocity;
|
// y_velocity = Math.random() > 0.5 ? -y_velocity : y_velocity;
|
||||||
// X max and min force
|
// X max and min force
|
||||||
let yminf = 1;
|
let yminf = 1;
|
||||||
let ymaxf = 2 + Math.random()*4;
|
// let ymaxf = 2 + Math.random()*4;
|
||||||
|
let ymaxf = 4 + Math.random()*2;
|
||||||
// scale factor
|
// scale factor
|
||||||
let yscale = (ymaxf-yminf) / (maxp-minp);
|
let yscale = (ymaxf-yminf) / (maxp-minp);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user