block object
This commit is contained in:
104
index.html
104
index.html
@@ -25,16 +25,20 @@
|
||||
<main>
|
||||
<h1>Visualizer</h1>
|
||||
<p>
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ullamcorper ut mauris sed tempor. Nunc
|
||||
vehicula tempor purus, non vestibulum libero ornare non. Morbi fringilla sapien diam, sed rhoncus lacus egestas
|
||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur ullamcorper ut mauris sed
|
||||
tempor. Nunc
|
||||
vehicula tempor purus, non vestibulum libero ornare non. Morbi fringilla sapien diam, sed
|
||||
rhoncus lacus egestas
|
||||
vel.
|
||||
</p>
|
||||
|
||||
<div class="figure" id="demo-1"></div>
|
||||
|
||||
<p>
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar ligula eu maximus.
|
||||
Curabitur vestibulum vitae orci ac laoreet. Donec vel imperdiet tortor. Vestibulum lobortis
|
||||
aliquam tellus,
|
||||
vitae viverra nisi porttitor quis. Pellentesque id efficitur arcu. Nunc laoreet pulvinar
|
||||
ligula eu maximus.
|
||||
Mauris ullamcorper accumsan dui vel pulvinar.
|
||||
</p>
|
||||
|
||||
@@ -44,11 +48,13 @@
|
||||
</div>
|
||||
|
||||
<p>
|
||||
Curabitur tincidunt sapien et diam fringilla, eu accumsan odio faucibus. Orci varius natoque penatibus et magnis
|
||||
Curabitur tincidunt sapien et diam fringilla, eu accumsan odio faucibus. Orci varius natoque
|
||||
penatibus et magnis
|
||||
dis parturient montes, nascetur ridiculus mus.
|
||||
</p>
|
||||
|
||||
<div id="atlas-container" style="position: fixed; left: 0; top: 0; border: 1px solid white;"></div>
|
||||
<div id="atlas-container"
|
||||
style="position: fixed; left: 0; top: 0; border: 1px solid white;"></div>
|
||||
</main>
|
||||
|
||||
<script type="module">
|
||||
@@ -62,45 +68,57 @@
|
||||
document.getElementById('atlas-container')?.appendChild(engine.atlas.canvas);
|
||||
|
||||
const world1 = new World();
|
||||
world1.setBlock('minecraft:redstone_wire', -1, 0, 0, {
|
||||
world1.set('minecraft:redstone_wire', -1, 0, 0, {
|
||||
east: 'side',
|
||||
west: 'none',
|
||||
north: 'none',
|
||||
south: 'none',
|
||||
power: '15'
|
||||
});
|
||||
world1.setBlock('minecraft:repeater', 0, 0, 0, {
|
||||
world1.set('minecraft:repeater', 0, 0, 0, {
|
||||
facing: 'east',
|
||||
delay: '1',
|
||||
locked: 'false',
|
||||
powered: 'true'
|
||||
});
|
||||
world1.setBlock('minecraft:oak_trapdoor', 2, 0, 0, {facing: 'east', half: 'bottom', open: 'true'});
|
||||
world1.setBlock('lodestone', 0, -1, 0);
|
||||
world1.setBlock('piston', 0, -2, 0, {facing: 'north', extended: 'false'});
|
||||
world1.set('minecraft:oak_trapdoor', 2, 0, 0, {
|
||||
facing: 'east',
|
||||
half: 'bottom',
|
||||
open: 'true'
|
||||
});
|
||||
world1.set('lodestone', 0, -1, 0);
|
||||
world1.set('piston', 0, -2, 0, {facing: 'north', extended: 'false'});
|
||||
|
||||
const world2 = new World();
|
||||
world2.setBlock('minecraft:redstone_wire', 0, 0, 0, {
|
||||
world2.set('minecraft:redstone_wire', 0, 0, 0, {
|
||||
east: 'side',
|
||||
west: 'none',
|
||||
north: 'none',
|
||||
south: 'none',
|
||||
power: '0'
|
||||
});
|
||||
world2.setBlock('minecraft:repeater', 1, 0, 0, {
|
||||
world2.set('minecraft:repeater', 1, 0, 0, {
|
||||
facing: 'east',
|
||||
delay: '4',
|
||||
locked: 'false',
|
||||
powered: 'false'
|
||||
});
|
||||
world2.setBlock('minecraft:sticky_piston', 2, 0, 0, {facing: 'east', extended: 'false'});
|
||||
world2.setBlock('minecraft:sticky_piston', 2, 0, 1, {facing: 'east', extended: 'true'});
|
||||
world2.setBlock('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'true'});
|
||||
world2.setBlock('minecraft:piston_head', 2.5, 0, 1, {facing: 'east', short: 'true', type: 'sticky'});
|
||||
world2.setBlock('minecraft:piston_head', 3, 0, 2, {facing: 'east', short: 'false', type: 'sticky'});
|
||||
world2.setBlock('minecraft:glass', 3, 0, 0);
|
||||
world2.setBlock('minecraft:observer', 3.5, 0, 1, {facing: 'up', powered: 'true'});
|
||||
world2.setBlock('minecraft:redstone_block', 4, 0, 2);
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 0, {facing: 'east', extended: 'false'});
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 1, {facing: 'east', extended: 'true'});
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'true'});
|
||||
world2.set('minecraft:piston_head', 2.5, 0, 1, {
|
||||
facing: 'east',
|
||||
short: 'true',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:piston_head', 3, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'false',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:glass', 3, 0, 0);
|
||||
world2.set('minecraft:observer', 3.5, 0, 1, {facing: 'up', powered: 'true'});
|
||||
world2.set('minecraft:redstone_block', 4, 0, 2);
|
||||
|
||||
const demo1 = new Diorama('demo-1', world1, () => engine.requestRender())
|
||||
demo1.radius = 2;
|
||||
@@ -130,34 +148,46 @@
|
||||
await engine.updateAll();
|
||||
|
||||
function set0() {
|
||||
world2.setBlock('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'false'});
|
||||
world2.setBlock('minecraft:redstone_block', 3, 0, 2);
|
||||
world2.removeBlock(2.5, 0, 2);
|
||||
world2.removeBlock(3.5, 0, 2);
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'false'});
|
||||
world2.set('minecraft:redstone_block', 3, 0, 2);
|
||||
world2.del(2.5, 0, 2);
|
||||
world2.del(3.5, 0, 2);
|
||||
setTimeout(set1, 250)
|
||||
}
|
||||
|
||||
function set1() {
|
||||
world2.setBlock('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'true'});
|
||||
world2.removeBlock(3, 0, 2)
|
||||
world2.setBlock('minecraft:piston_head', 2.5, 0, 2, {facing: 'east', short: 'true', type: 'sticky'});
|
||||
world2.setBlock('minecraft:redstone_block', 3.5, 0, 2);
|
||||
world2.set('minecraft:sticky_piston', 2, 0, 2, {facing: 'east', extended: 'true'});
|
||||
world2.del(3, 0, 2)
|
||||
world2.set('minecraft:piston_head', 2.5, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'true',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:redstone_block', 3.5, 0, 2);
|
||||
setTimeout(set2, 250)
|
||||
}
|
||||
|
||||
function set2() {
|
||||
world2.setBlock('minecraft:piston_head', 3, 0, 2, {facing: 'east', short: 'false', type: 'sticky'});
|
||||
world2.removeBlock(2.5, 0, 2);
|
||||
world2.removeBlock(3.5, 0, 2);
|
||||
world2.setBlock('minecraft:redstone_block', 4, 0, 2);
|
||||
world2.set('minecraft:piston_head', 3, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'false',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.del(2.5, 0, 2);
|
||||
world2.del(3.5, 0, 2);
|
||||
world2.set('minecraft:redstone_block', 4, 0, 2);
|
||||
setTimeout(set3, 250)
|
||||
}
|
||||
|
||||
function set3() {
|
||||
world2.removeBlock(4, 0, 2)
|
||||
world2.removeBlock(3, 0, 2)
|
||||
world2.setBlock('minecraft:piston_head', 2.5, 0, 2, {facing: 'east', short: 'true', type: 'sticky'});
|
||||
world2.setBlock('minecraft:redstone_block', 3.5, 0, 2);
|
||||
world2.del(4, 0, 2)
|
||||
world2.del(3, 0, 2)
|
||||
world2.set('minecraft:piston_head', 2.5, 0, 2, {
|
||||
facing: 'east',
|
||||
short: 'true',
|
||||
type: 'sticky'
|
||||
});
|
||||
world2.set('minecraft:redstone_block', 3.5, 0, 2);
|
||||
setTimeout(set0, 250)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user