You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
12345678910111213 |
- import {Trait} from '../Entity.js';
-
- export default class Physics extends Trait {
- constructor(entity) {
- super(entity, "physics");
-
- this.gravity = 9.81;
- }
-
- update(dt) {
- this.entity.velocity.y += this.gravity * dt;
- }
- }
|