Improve physics

This commit is contained in:
schmelczerandras 2020-10-06 09:26:56 +02:00
parent 8b87b68dae
commit ec0b700313
14 changed files with 181 additions and 71 deletions

View file

@ -0,0 +1,9 @@
import { Command } from '../command';
export class StepCommand extends Command {
public static readonly type = 'StepCommand';
public constructor(public readonly deltaTimeInMiliseconds: DOMHighResTimeStamp) {
super();
}
}

View file

@ -3,6 +3,7 @@ export * from './commands/types/create-objects';
export * from './commands/types/create-player';
export * from './commands/types/delete-objects';
export * from './commands/types/update-objects';
export * from './commands/types/step';
export * from './commands/types/ternary-action';
export * from './commands/types/move-action';
export * from './commands/types/set-view-area-action';

View file

@ -5,9 +5,9 @@ export const settings = {
hitDetectionCirclePointCount: 32,
hitDetectionMaxOverlap: 0.01,
physicsMaxStep: 5,
gravitationalForce: vec2.fromValues(0, -0.015),
gravitationalForce: vec2.fromValues(0, -0.005),
maxVelocityX: 1.5,
maxVelocityY: 8,
velocityAttenuation: 0.99,
maxVelocityY: 20,
velocityAttenuation: 0.98,
inViewAreaSize: 1920 * 1080 * 3,
};