Permalink
Browse files
now score starts counting when you are out of the spawn
|
@@ -9,6 +9,9 @@ namespace Assets.Generation |
|
|
{
|
|
|
public class WorldGenerator : IDisposable
|
|
|
{
|
|
|
+ public const float SpawnRadius = 64f;
|
|
|
+ public static Vector3 SpawnPosition = Vector3.forward * 32f;
|
|
|
+
|
|
|
public void BuildArray(float[][][] Densities)
|
|
|
{
|
|
|
for (int x = 0; x < Chunk.ChunkSize; x++)
|
|
@@ -42,7 +45,7 @@ public void Generate(float[][][] Densities, Vector3 Offsets) |
|
|
Densities [x] [y] [z] = Mathf.Lerp (prev, next, (float) (z / (float) lerp) );
|
|
|
|
|
|
//Make a sphere on spawn point
|
|
|
- Densities [x] [y] [z] = ( ( Vector3.forward * 32f - new Vector3(x + Offsets.x, y + Offsets.y, z + Offsets.z) ).sqrMagnitude < 64f*64f) ? 0 : Densities[x][y][z];
|
|
|
+ Densities [x] [y] [z] = ( ( SpawnPosition - new Vector3(x + Offsets.x, y + Offsets.y, z + Offsets.z) ).sqrMagnitude < SpawnRadius*SpawnRadius) ? 0 : Densities[x][y][z];
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
@@ -6,6 +6,7 @@ |
|
|
using UnityEngine;
|
|
|
using System.Collections;
|
|
|
using Assets;
|
|
|
+using Assets.Generation;
|
|
|
|
|
|
public class Movement : MonoBehaviour {
|
|
|
|
|
@@ -23,6 +24,10 @@ public class Movement : MonoBehaviour { |
|
|
private float _originalVolume;
|
|
|
private float _speed = 0;
|
|
|
|
|
|
+ public bool IsInSpawn{
|
|
|
+ get{ return (transform.parent.position - WorldGenerator.SpawnPosition).sqrMagnitude < WorldGenerator.SpawnRadius * WorldGenerator.SpawnRadius; }
|
|
|
+ }
|
|
|
+
|
|
|
void Start(){
|
|
|
Debris = GameObject.FindGameObjectWithTag ("Debris");
|
|
|
LeftSource = GameObject.FindGameObjectWithTag ("LeftSource").GetComponent<AudioSource>();
|
|
|
|
@@ -175,7 +175,9 @@ public class TimeControl : MonoBehaviour { |
|
|
if(!Using)
|
|
|
WasPressed = Input.GetKey(KeyCode.Space);
|
|
|
|
|
|
- _score += Time.deltaTime * 8;
|
|
|
+ if(!_movement.IsInSpawn)
|
|
|
+ _score += Time.deltaTime * 8;
|
|
|
+
|
|
|
if (_score < 125)
|
|
|
_movement.Speed = 12;
|
|
|
else if (_score < 275)
|
|
|
|
|
@@ -1,9 +1,9 @@ |
|
|
<Properties StartupItem="Assembly-CSharp.csproj">
|
|
|
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" PreferredExecutionTarget="Unity.Instance.Unity Editor" />
|
|
|
- <MonoDevelop.Ide.Workbench ActiveDocument="Assets\Generation\GenerationQueue.cs">
|
|
|
+ <MonoDevelop.Ide.Workbench ActiveDocument="Assets\Generation\MeshQueue.cs">
|
|
|
<Files>
|
|
|
- <File FileName="Assets\Generation\GenerationQueue.cs" Line="24" Column="25" />
|
|
|
- <File FileName="Assets\Generation\MeshQueue.cs" Line="10" Column="19" />
|
|
|
+ <File FileName="Assets\Generation\GenerationQueue.cs" Line="1" Column="1" />
|
|
|
+ <File FileName="Assets\Generation\MeshQueue.cs" Line="29" Column="1" />
|
|
|
</Files>
|
|
|
</MonoDevelop.Ide.Workbench>
|
|
|
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
|
|
0 comments on commit
52a6983