Skip to content
Snippets Groups Projects
Commit 8f234ae7 authored by Erno Lokkila's avatar Erno Lokkila
Browse files

sliced quarry and adjusted sprite depths

parent 59aa1e52
No related branches found
No related tags found
No related merge requests found
......@@ -20,6 +20,11 @@ public class GroundGenerator : MonoBehaviour
private int stone = 3;
private int wood = 4;
private int home = 5;
private int groundDepth = 1;
private int resourceDepth = 0;
private int houseDepth = -2;
private int workerDepth = -1;
/*
0,1,2
3,4,5
......@@ -77,39 +82,39 @@ public class GroundGenerator : MonoBehaviour
if (ground[i - 1, j] == 0 && ground[i, j - 1] == 0)
{
spawn(tiles[6], i, j);
spawn(tiles[6], i, j, groundDepth);
}
else if (ground[i + 1, j] == 0 && ground[i, j - 1] == 0)
{
spawn(tiles[8], i, j);
spawn(tiles[8], i, j, groundDepth);
}
else if (ground[i + 1, j] == 0 && ground[i, j + 1] == 0)
{
spawn(tiles[2], i, j);
spawn(tiles[2], i, j, groundDepth);
}
else if (ground[i - 1, j] == 0 && ground[i, j + 1] == 0)
{
spawn(tiles[0], i, j);
spawn(tiles[0], i, j, groundDepth);
}
else if (ground[i + 1, j] == 0)
{
spawn(tiles[5], i, j);
spawn(tiles[5], i, j, groundDepth);
}
else if (ground[i - 1, j] == 0)
{
spawn(tiles[3], i, j);
spawn(tiles[3], i, j, groundDepth);
}
else if (ground[i, j + 1] == 0)
{
spawn(tiles[1], i, j);
spawn(tiles[1], i, j, groundDepth);
}
else if (ground[i, j - 1] == 0)
{
spawn(tiles[7], i, j);
spawn(tiles[7], i, j, groundDepth);
}
else
{
spawn(tiles[4], i, j);
spawn(tiles[4], i, j, groundDepth);
}
}
}
......@@ -123,15 +128,15 @@ public class GroundGenerator : MonoBehaviour
{
if (ground[i, j] == wood)
{
spawn(resourceGOs[0], i, j, -1);
spawn(resourceGOs[0], i, j, resourceDepth);
}
if (ground[i, j] == stone)
{
spawn(resourceGOs[1], i, j,- 1);
spawn(resourceGOs[1], i, j, resourceDepth);
}
if (ground[i, j] == food)
{
spawn(resourceGOs[2], i, j, -1);
spawn(resourceGOs[2], i, j, resourceDepth);
}
}
}
......@@ -139,10 +144,10 @@ public class GroundGenerator : MonoBehaviour
private void createHome() {
ground[ground.GetLength(0) / 2, ground.GetLength(1) / 2] = home;
spawn(homeGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, 0);
spawn(workerGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, -3);
spawn(homeGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, houseDepth);
spawn(workerGO, ground.GetLength(0) / 2, ground.GetLength(1) / 2, workerDepth);
}
private GameObject spawn(GameObject go, int x, int y, int z = 1) {
private GameObject spawn(GameObject go, int x, int y, int z) {
return Instantiate<GameObject>(go, new Vector3(x, y, z), Quaternion.identity);
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 69185a3ed6e033642b69e02c07c3804c
TextureImporter:
fileIDToRecycleName:
21300000: quarry_0
21300002: quarry_1
21300004: quarry_2
21300006: quarry_3
21300008: quarry_4
21300010: quarry_5
externalObjects: {}
serializedVersion: 9
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 128
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: WebGL
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: quarry_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 128
height: 128
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 5b21b428a81efa343965a917902c626c
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: quarry_1
rect:
serializedVersion: 2
x: 128
y: 0
width: 128
height: 128
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 121dca7da97c6e844b93bc231477bbe7
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: quarry_2
rect:
serializedVersion: 2
x: 256
y: 0
width: 128
height: 128
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: c263a526c8022ce47a501fd54a54def4
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: quarry_3
rect:
serializedVersion: 2
x: 384
y: 0
width: 128
height: 128
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: d46b9cfa4b70ee7419bc4b6b69a4624a
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: quarry_4
rect:
serializedVersion: 2
x: 512
y: 0
width: 128
height: 128
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: e1c4d9d6be834a8449502b5c5563c471
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: quarry_5
rect:
serializedVersion: 2
x: 640
y: 0
width: 128
height: 128
alignment: 0
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: a76034e1a25282847b2c2df920561525
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: 82d43787e602dd84287500c180be9b8f
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment