Skip to content
Snippets Groups Projects
Commit edee050b authored by Tuula's avatar Tuula
Browse files

Adjust grass spawn rate and add WebGL template

parent 1f398263
No related branches found
No related tags found
No related merge requests found
Pipeline #81242 passed
Showing
with 94 additions and 3 deletions
......@@ -38,6 +38,7 @@ public class Bubble : MonoBehaviour
public InputAction leftTouchMoveAction;
public InputAction rightTouchMoveAction;
public float Score {get{return score;}}
public bool Grass {get{return grass;}}
private void Awake()
{
......
......@@ -138,7 +138,7 @@ public class GameLoop : MonoBehaviour
else
{
spawnDelay -= spawnStep;
if (spawnDelay <= spawnDelayMin)
if (spawnDelay < spawnDelayMin)
{
spawnDelayMultiplier *= 0.9f;
if (spawnDelayMax * spawnDelayMultiplier < spawnDelayMin) spawnDelayMultiplier = 0.25f;
......@@ -146,12 +146,12 @@ public class GameLoop : MonoBehaviour
foreach (var bub in bubblePrefabs.Where(x => x.BubblePrefab.Score < 0))
{
bub.IncreaseWeight((int)(popCount / 2f));
popCount = 0;
}
popCount = 0;
}
}
var bubble = CreateBubble();
bubbles.Add(bubble);
if (bubble != null) bubbles.Add(bubble);
timer = 0;
}
}
......@@ -170,6 +170,7 @@ public class GameLoop : MonoBehaviour
rng -= weight.Weight;
if (rng < 0)
{
if (weight.BubblePrefab.Grass && bubbles.Where(x => x.Grass).Count() > 0) break;
var rng2 = UnityEngine.Random.Range(0, spawnPoints.Count);
bubble = Instantiate( weight.BubblePrefab, spawnPoints[rng2]);
bubble.Init(() => { weight.IncreaseWeight(1);});
......
fileFormatVersion: 2
guid: 86d96d007db412649afd0f500b1a8ee9
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0b7b9c01f45dd4946a997b2af1b297a1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 05846ad2c7f893441bdca3a278230809
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/WebGLTemplates/Template/TemplateData/MemoryProfiler.png

665 B

fileFormatVersion: 2
guid: e2d9c544c0fece642b464a819df82ec2
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/WebGLTemplates/Template/TemplateData/favicon.ico

2.25 KiB

fileFormatVersion: 2
guid: ca1c2632adc118641af0088dc591b644
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/WebGLTemplates/Template/TemplateData/fullscreen-button.png

175 B

fileFormatVersion: 2
guid: 33a7382e32c175447bcda7eeb2660afe
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/WebGLTemplates/Template/TemplateData/progress-bar-empty-dark.png

96 B

fileFormatVersion: 2
guid: 0ca854a61d8d6ed479c0ba29fe85cf93
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/WebGLTemplates/Template/TemplateData/progress-bar-empty-light.png

109 B

fileFormatVersion: 2
guid: f0e1a3338d294ca43ad0be211a9b239b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/WebGLTemplates/Template/TemplateData/progress-bar-full-dark.png

74 B

fileFormatVersion: 2
guid: b8d5367ce852b2e4e8ec08bc5a0fea6a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/WebGLTemplates/Template/TemplateData/progress-bar-full-light.png

84 B

fileFormatVersion: 2
guid: f48b7df29f994a44fb1accd41ead5bb0
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
body { padding: 0; margin: 0 }
#unity-container { position: absolute }
#unity-container.unity-desktop { left: 50%; top: 50%; transform: translate(-50%, -50%) }
#unity-container.unity-mobile { position: fixed; width: 100%; height: 100% }
#unity-canvas { background: {{{ BACKGROUND_COLOR }}} }
.unity-mobile #unity-canvas { width: 100%; height: 100% }
#unity-loading-bar { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: none }
#unity-logo { width: 154px; height: 130px; background: url('unity-logo-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png') no-repeat center }
#unity-progress-bar-empty { width: 141px; height: 18px; margin-top: 10px; margin-left: 6.5px; background: url('progress-bar-empty-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png') no-repeat center }
#unity-progress-bar-full { width: 0%; height: 18px; margin-top: 10px; background: url('progress-bar-full-{{{ SPLASH_SCREEN_STYLE.toLowerCase() }}}.png') no-repeat center }
#unity-footer { position: relative }
.unity-mobile #unity-footer { display: none }
#unity-webgl-logo { float:left; width: 204px; height: 38px; background: url('webgl-logo.png') no-repeat center }
#unity-build-title { float: right; margin-right: 10px; line-height: 38px; font-family: arial; font-size: 18px }
#unity-fullscreen-button { cursor:pointer; float: right; width: 38px; height: 38px; background: url('fullscreen-button.png') no-repeat center }
#unity-warning { position: absolute; left: 50%; top: 5%; transform: translate(-50%); background: white; padding: 10px; display: none }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment