trunc | floor | ceil | round | ~~v | v | 0 | v << 0 | v >> 0 | v >>> 0 | |
---|---|---|---|---|---|---|---|---|---|
3.8 | 3 | 3 | 4 | 4 | 3 | 3 | 3 | 3 | 3 |
3.2 | 3 | 3 | 4 | 3 | 3 | 3 | 3 | 3 | 3 |
-3.2 | -3 | -4 | -3 | -3 | -3 | -3 | -3 | -3 | 4294967293 |
-3.8 | -3 | -4 | -3 | -4 | -3 | -3 | -3 | -3 | 4294967293 |
Uniform distribution
Somehow normal distribution
Uniform distribution
Somehow normal distribution
60 FPS
20 FPS
5 FPS
60 FPS
20 FPS
5 FPS
...
"warrior07": {
"frame": {
"x": 1584, "y": 540,
"w": 528, "h": 540
}
}
},
"animations": {
"warrior": ["warrior01","warrior02","warrior03",
"warrior04","warrior05","warrior06","warrior07"]
},
"meta": {
"image": "warrior.png", "format": "RGBA8888",
"size": {"w":2033,"h":2030}, "scale": "1"
}
}
let sheet = this.engine.app.loader.resources['./assets/lab02/warrior.json'].spritesheet;
let animation = new PIXI.AnimatedSprite(sheet.animations['warrior']);
animation.animationSpeed = 0.167;
animation.loop = true;
animation.play();
{
"frames": {
"background.png":
{
"frame": {"x":1,"y":1,"w":1920,"h":1080},
"rotated": false,
"spriteSourceSize": {"x":0,"y":0,"w":1920,"h":1080},
"sourceSize": {"w":1920,"h":1080},
"anchor": {"x":0,"y":0}
},
"frame01.png":
{
"frame": {"x":1106,"y":1379,"w":158,"h":316},
"rotated": true,
"trimmed": true,
"spriteSourceSize": {"x":15,"y":3,"w":158,"h":316},
"sourceSize": {"w":187,"h":324},
"anchor": {"x":0.5,"y":1}
}
},
"animations": {
"anim01": ["frame01","frame02.png","frame03.png"],
"anim02": ["frame65","frame66","frame67"]
},
"meta": {
"image": "spritesheet.png",
"format": "RGBA8888",
"size": {"w":2033,"h":2030},
}
}
let texture = this.engine.app.loader.resources[SPRITESHEET].texture;
let frames = 5, frameCounter = 0;
new ECSA.Builder(this.engine.scene)
.asSprite(texture)
.withParent(this.engine.scene.stage)
.anchor(0.5)
.withComponent(new ECSA.GenericComponent('animator')
.setFrequency(10)
.doOnUpdate((cmp, delta, absolute) => {
cmp.owner.asSprite().texture.frame = new PIXI.Rectangle(
(texture.width / frames) * (frameCounter++ % frames),
0, texture.width / frames, texture.height);
}))
.build();
const factory = PixiFactory.factory;
factory.parseDragonBonesData(this.engine.app.loader.resources['Demon_ske.json'].data);
factory.parseTextureAtlasData(this.engine.app.loader.resources['Demon_tex.json'].data,
this.engine.app.loader.resources['Demon_tex.png'].texture);
const armatureDisplay = factory.buildArmatureDisplay('Demon', 'Demon');
armatureDisplay.animation.play('normalAttack', 1);
20 objects, 5 for each cell
50 objects, 10 for each cell
100 objects, 2 for each cell
let engine = Matter.Engine.create();
let world = engine.world;
let render = Matter.Render.create({
element: document.body,
engine: engine });
Render.run(render);
// insert objects
Matter.World.add(world, Matter.Composites.car(150, 100, 150, 30, 30));
let runner = Matter.Runner.create();
Matter.Runner.run(runner, engine);
Matter.Render.lookAt(render, {
min: { x: 0, y: 0 },
max: { x: 800, y: 600 }
});