Skip to content

Commit 077fc50

Browse files
committed
anvilTest
1 parent 17402b8 commit 077fc50

File tree

5 files changed

+26
-9
lines changed

5 files changed

+26
-9
lines changed

assets/models/anvil.blend

759 KB
Binary file not shown.

assets/models/anvil.fbx

15.5 KB
Binary file not shown.

assets/textures/Terrain.png

90.1 KB
Loading

assets/textures/mcatlas.png

86.8 KB
Loading

index.html

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ <h3>Gra zatrzymana</h3>
133133
name:"grass",
134134
isSolid:true,
135135
faces: {
136-
nx: [2, 15],
136+
nx: [3, 15],
137137
ny: [2, 15],
138-
nz: [2, 15],
139-
px: [2, 15],
140-
py: [2, 15],
141-
pz: [2, 15]
138+
nz: [3, 15],
139+
px: [3, 15],
140+
py: [0, 15],
141+
pz: [3, 15]
142142
}
143143
},
144144
2: {
@@ -169,6 +169,11 @@ <h3>Gra zatrzymana</h3>
169169
name:"stairs",
170170
isSolid:false,
171171
model:"assets/models/stairs.fbx"
172+
},
173+
5: {
174+
name:"stairs",
175+
isSolid:false,
176+
model:"assets/models/anvil.fbx"
172177
}
173178
}
174179
}
@@ -311,6 +316,11 @@ <h3>Gra zatrzymana</h3>
311316
geo=geo.applyMatrix4(matrix)
312317
geo.translate(0,-0.25,0)
313318
return [geo]
319+
}if(voxel==5){
320+
var geo=anvilGeometry.clone()
321+
geo=geo.applyMatrix4(matrix)
322+
geo.translate(0,-0.25,0)
323+
return [geo]
314324
}else{
315325
if (voxel!=0 && voxel!=4) {
316326
var geometries = [];
@@ -625,7 +635,7 @@ <h3>Gra zatrzymana</h3>
625635

626636

627637
var canvas,renderer,scene,camera,stats,raycaster,
628-
gameState,stairsGeometry,world,cube,FPC;
638+
gameState,stairsGeometry,world,cube,FPC,anvilGeometry;
629639

630640
init()
631641
animate()
@@ -655,7 +665,7 @@ <h3>Gra zatrzymana</h3>
655665

656666
raycaster = new THREE.Raycaster();
657667

658-
var texture = new THREE.TextureLoader().load('assets/textures/atla.png');
668+
var texture = new THREE.TextureLoader().load('assets/textures/mcatlas.png');
659669
texture.magFilter = THREE.NearestFilter;
660670

661671
gameState="menu";
@@ -672,6 +682,12 @@ <h3>Gra zatrzymana</h3>
672682
stairsGeometry=object.children[0].geometry
673683
stairsGeometry.scale(10,10,10)
674684
});
685+
loader.load( 'assets/models/anvil.fbx', function ( object ) {
686+
anvilGeometry=object.children[0].geometry
687+
anvilGeometry.scale(1,1,1)
688+
anvilGeometry.rotateX(-Math.PI/2)
689+
anvilGeometry.translate(0,0.17,0)
690+
});
675691

676692
world = new Terrain({
677693
textureAtlas: texture,
@@ -692,15 +708,16 @@ <h3>Gra zatrzymana</h3>
692708
}
693709
var inv_bar = new InventoryBar({
694710
boxSize: 60,
695-
boxes: 4,
711+
boxes: 5,
696712
padding: 4,
697713
div: ".inventoryBar",
698714
activeBox: 1
699715
})
700-
inv_bar.setBox(1,"https://gamepedia.cursecdn.com/minecraft_gamepedia/6/62/Dirt_JE2_BE1.png")
716+
inv_bar.setBox(1,"https://gamepedia.cursecdn.com/minecraft_gamepedia/6/6a/Grass_Block_JE6_BE5.png")
701717
inv_bar.setBox(2,"https://gamepedia.cursecdn.com/minecraft_gamepedia/2/29/Stone_JE4_BE2.png")
702718
inv_bar.setBox(3,"https://gamepedia.cursecdn.com/minecraft_gamepedia/3/37/Oak_Planks_JE6_BE3.png")
703719
inv_bar.setBox(4,"https://gamepedia.cursecdn.com/minecraft_gamepedia/archive/e/e0/20200317210502%21Stone_Brick_Stairs_JE3_BE2.png?version=29cb53ead07bbd3a08d158397d1078d5")
720+
inv_bar.setBox(5,"https://vignette.wikia.nocookie.net/minecraft/images/4/4e/AnvilNew.png/revision/latest?cb=20200226224259")
704721
inv_bar.setFocusOnly(1)
705722

706723
$(window).on('wheel', function (event) {

0 commit comments

Comments
 (0)