Division Berry
new berry for bdc game
This commit is contained in:
1 parent
c02edbc230
commit
57968c1bbd
4 files changed
+208
-2
No files matched your search
Binary file not shown.
|
After Width: | Height: | Size: 5.0 KiB |
@@ -0,0 +1,143 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d8d5b2522fdd80a4a9a6e09b7b0543c0
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: 5136007301498354809
|
||||
second: DivisionBerry_0
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
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
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
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: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 4
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: DivisionBerry_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 7
|
||||
y: 3
|
||||
width: 114
|
||||
height: 122
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 97c3f91dd63c64740800000000000000
|
||||
internalID: 5136007301498354809
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable:
|
||||
DivisionBerry_0: 5136007301498354809
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -599,4 +599,20 @@ public class BazookaManager : MonoBehaviour
|
||||
if (saveFile["gameStore"] == null) return;
|
||||
(saveFile["gameStore"] as JObject)?.Remove("totalEvilBerries");
|
||||
}
|
||||
public void SetGameStoreTotalDivisionBerries(BigInteger value)
|
||||
{
|
||||
if (saveFile["gameStore"] == null) saveFile["gameStore"] = new JObject();
|
||||
saveFile["gameStore"]["totalDivisionBerries"] = value.ToString();
|
||||
}
|
||||
public BigInteger GetGameStoreTotalDivisionBerries()
|
||||
{
|
||||
if (saveFile["gameStore"] == null) return 0;
|
||||
if (saveFile["gameStore"]["totalDivisionBerries"] == null) return 0;
|
||||
return BigInteger.Parse(saveFile["gameStore"]["totalDivisionBerries"].ToString());
|
||||
}
|
||||
public void UnsetGameStoreTotalDivisionBerries()
|
||||
{
|
||||
if (saveFile["gameStore"] == null) return;
|
||||
(saveFile["gameStore"] as JObject)?.Remove("totalDivisionBerries");
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ public class GamePlayer : MonoBehaviour
|
||||
private BigInteger totalPurpleBerries;
|
||||
private BigInteger totalTimeFreezeBerries;
|
||||
private BigInteger totalEvilBerries;
|
||||
private BigInteger totalDivisionBerries;
|
||||
private BigInteger totalAttempts;
|
||||
private float boostLeft;
|
||||
private float slownessLeft;
|
||||
@@ -123,6 +124,7 @@ public class GamePlayer : MonoBehaviour
|
||||
totalPurpleBerries = BazookaManager.Instance.GetGameStoreTotalPurpleBerries();
|
||||
totalTimeFreezeBerries = BazookaManager.Instance.GetGameStoreTotalTimeFreezeBerries();
|
||||
totalEvilBerries = BazookaManager.Instance.GetGameStoreTotalEvilBerries();
|
||||
totalDivisionBerries = BazookaManager.Instance.GetGameStoreTotalDivisionBerries();
|
||||
totalAttempts = BazookaManager.Instance.GetGameStoreTotalAttepts();
|
||||
|
||||
Cursor.visible = false;
|
||||
@@ -230,7 +232,7 @@ public class GamePlayer : MonoBehaviour
|
||||
}
|
||||
if (antiLeft > 0f)
|
||||
{
|
||||
string[] berryTags = { "NormalBerry", "PoisonBerry", "SlowBerry", "UltraBerry", "SpeedyBerry", "RandomBerry", "AntiBerry", "TimeSlowBerry", "PurpleBerry", "TimeFreezeBerry", "EvilBerry" };
|
||||
string[] berryTags = { "NormalBerry", "PoisonBerry", "SlowBerry", "UltraBerry", "SpeedyBerry", "RandomBerry", "AntiBerry", "TimeSlowBerry", "PurpleBerry", "TimeFreezeBerry", "EvilBerry", "DivisionBerry" };
|
||||
foreach (string tag in berryTags)
|
||||
{
|
||||
foreach (var berry in GameObject.FindGameObjectsWithTag(tag))
|
||||
@@ -379,11 +381,16 @@ public class GamePlayer : MonoBehaviour
|
||||
spriteRenderer.sprite = Resources.Load<Sprite>("Berries/TimeFreezeBerry");
|
||||
newBerry.tag = "TimeFreezeBerry";
|
||||
}
|
||||
else
|
||||
else if (spawnProbability <= 0.99f)
|
||||
{
|
||||
spriteRenderer.sprite = Resources.Load<Sprite>("Berries/EvilBerry");
|
||||
newBerry.tag = "EvilBerry";
|
||||
}
|
||||
else
|
||||
{
|
||||
spriteRenderer.sprite = Resources.Load<Sprite>("Berries/DivisionBerry");
|
||||
newBerry.tag = "DivisionBerry";
|
||||
}
|
||||
spriteRenderer.sortingOrder = -5;
|
||||
|
||||
float screenWidth = Camera.main.orthographicSize * 2 * Camera.main.aspect;
|
||||
@@ -417,6 +424,7 @@ public class GamePlayer : MonoBehaviour
|
||||
.Concat(GameObject.FindGameObjectsWithTag("PurpleBerry"))
|
||||
.Concat(GameObject.FindGameObjectsWithTag("TimeFreezeBerry"))
|
||||
.Concat(GameObject.FindGameObjectsWithTag("EvilBerry"))
|
||||
.Concat(GameObject.FindGameObjectsWithTag("DivisionBerry"))
|
||||
.ToArray();
|
||||
foreach (GameObject berry in allberries)
|
||||
{
|
||||
@@ -434,6 +442,7 @@ public class GamePlayer : MonoBehaviour
|
||||
GameObject[] purpleBerries = GameObject.FindGameObjectsWithTag("PurpleBerry");
|
||||
GameObject[] timeFreezeBerries = GameObject.FindGameObjectsWithTag("TimeFreezeBerry");
|
||||
GameObject[] evilBerries = GameObject.FindGameObjectsWithTag("EvilBerry");
|
||||
GameObject[] divisionBerries = GameObject.FindGameObjectsWithTag("DivisionBerry");
|
||||
|
||||
if (!pausePanel.activeSelf)
|
||||
{
|
||||
@@ -758,6 +767,34 @@ public class GamePlayer : MonoBehaviour
|
||||
evilBerry.GetComponent<Rigidbody2D>().linearVelocity = new UnityEngine.Vector2(0f, -4f);
|
||||
}
|
||||
}
|
||||
foreach (GameObject divisionBerry in divisionBerries)
|
||||
{
|
||||
if (divisionBerry.transform.position.y < 0f - Camera.main.orthographicSize - 1f)
|
||||
{
|
||||
Destroy(divisionBerry);
|
||||
}
|
||||
else if (UnityEngine.Vector3.Distance(bird.transform.position, divisionBerry.transform.position) < 1.5f)
|
||||
{
|
||||
totalDivisionBerries++;
|
||||
DoDivisionBerry(divisionBerry);
|
||||
}
|
||||
if (timeFreezeLeft > 0)
|
||||
{
|
||||
divisionBerry.GetComponent<Rigidbody2D>().linearVelocity = new UnityEngine.Vector2(0f, 0f);
|
||||
}
|
||||
else if (timeSlowLeft > 0)
|
||||
{
|
||||
divisionBerry.GetComponent<Rigidbody2D>().linearVelocity = new UnityEngine.Vector2(0f, -2f);
|
||||
}
|
||||
else if (speedyLeft > 0)
|
||||
{
|
||||
divisionBerry.GetComponent<Rigidbody2D>().linearVelocity = new UnityEngine.Vector2(0f, -7.5f);
|
||||
}
|
||||
else
|
||||
{
|
||||
divisionBerry.GetComponent<Rigidbody2D>().linearVelocity = new UnityEngine.Vector2(0f, -4f);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -774,6 +811,7 @@ public class GamePlayer : MonoBehaviour
|
||||
.Concat(purpleBerries)
|
||||
.Concat(timeFreezeBerries)
|
||||
.Concat(evilBerries)
|
||||
.Concat(divisionBerries)
|
||||
.ToArray();
|
||||
foreach (GameObject berry in allberries)
|
||||
{
|
||||
@@ -809,6 +847,7 @@ public class GamePlayer : MonoBehaviour
|
||||
.Concat(GameObject.FindGameObjectsWithTag("PurpleBerry"))
|
||||
.Concat(GameObject.FindGameObjectsWithTag("TimeFreezeBerry"))
|
||||
.Concat(GameObject.FindGameObjectsWithTag("EvilBerry"))
|
||||
.Concat(GameObject.FindGameObjectsWithTag("DivisionBerry"))
|
||||
.ToArray();
|
||||
foreach (GameObject berry in allberries)
|
||||
{
|
||||
@@ -841,6 +880,7 @@ public class GamePlayer : MonoBehaviour
|
||||
BazookaManager.Instance.SetGameStoreTotalPurpleBerries(totalPurpleBerries);
|
||||
BazookaManager.Instance.SetGameStoreTotalTimeFreezeBerries(totalTimeFreezeBerries);
|
||||
BazookaManager.Instance.SetGameStoreTotalEvilBerries(totalEvilBerries);
|
||||
BazookaManager.Instance.SetGameStoreTotalDivisionBerries(totalDivisionBerries);
|
||||
BazookaManager.Instance.SetGameStoreTotalAttepts(totalAttempts);
|
||||
scoreText.text = $"Score: {Tools.FormatWithCommas(score)} \\u2022 Attempts: {Tools.FormatWithCommas(attempts)}";
|
||||
highScoreText.text = prefix + $"High Score: {Tools.FormatWithCommas(highscore) + suffix} \\u2022 Total Attempts: {Tools.FormatWithCommas(totalAttempts)}";
|
||||
@@ -1022,4 +1062,11 @@ public class GamePlayer : MonoBehaviour
|
||||
score = 0;
|
||||
}
|
||||
}
|
||||
void DoDivisionBerry(GameObject berry)
|
||||
{
|
||||
AudioSource.PlayClipAtPoint(Resources.Load<AudioClip>("Sounds/Downgrade"), Camera.main.transform.position, 1.2f * BazookaManager.Instance.GetSettingSFXVolume());
|
||||
Destroy(berry);
|
||||
score = score / 2;
|
||||
UpdateStats(0, 0);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user