import Ball from "./Ball";

export default class World extends p2.World {
    _root: egret.DisplayObjectContainer;
    constructor(root: egret.DisplayObjectContainer, options?: any) {
        super(options);
        this._root = root;
        this.init();
    }

    loop(): any {
        this.bodies.forEach(body => {
            if (body instanceof Ball) {
                body.updateSkin();
            }
        });
    }

    init() {
        this.gravity = [0, 10];
    }
}