Skip to content
Snippets Groups Projects
Commit 599d201d authored by Adam Elfawal's avatar Adam Elfawal
Browse files

We are ready B)

parent a7039cec
No related merge requests found
......@@ -11,4 +11,4 @@ PhysicMaterial:
staticFriction: 1
bounciness: 0.7
frictionCombine: 0
bounceCombine: 3
bounceCombine: 0
......@@ -49,6 +49,7 @@ MonoBehaviour:
health: 1
destroyMode: 0
stateChangePrefab: {fileID: 0}
breakScore: 0
--- !u!1001 &2689500083924181627
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -59,15 +60,15 @@ PrefabInstance:
m_Modifications:
- target: {fileID: -8679921383154817045, guid: cfd7d54d381334ad1806dd61b79b2b7d, type: 3}
propertyPath: m_LocalScale.x
value: 3
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cfd7d54d381334ad1806dd61b79b2b7d, type: 3}
propertyPath: m_LocalScale.y
value: 3
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cfd7d54d381334ad1806dd61b79b2b7d, type: 3}
propertyPath: m_LocalScale.z
value: 3
value: 1
objectReference: {fileID: 0}
- target: {fileID: -8679921383154817045, guid: cfd7d54d381334ad1806dd61b79b2b7d, type: 3}
propertyPath: m_LocalPosition.x
......@@ -485,12 +486,24 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 1463368340771084, guid: 4bc48771517f84804bfe1e21d8bbdbe5, type: 3}
propertyPath: m_IsActive
value: 0
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1463368340771084, guid: 4bc48771517f84804bfe1e21d8bbdbe5, type: 3}
propertyPath: m_TagString
value: Breaking
objectReference: {fileID: 0}
- target: {fileID: 4536424364635226, guid: 4bc48771517f84804bfe1e21d8bbdbe5, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4536424364635226, guid: 4bc48771517f84804bfe1e21d8bbdbe5, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4536424364635226, guid: 4bc48771517f84804bfe1e21d8bbdbe5, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 4536424364635226, guid: 4bc48771517f84804bfe1e21d8bbdbe5, type: 3}
propertyPath: m_LocalPosition.x
value: 0
......@@ -531,6 +544,10 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4536424364635226, guid: 4bc48771517f84804bfe1e21d8bbdbe5, type: 3}
propertyPath: m_ConstrainProportionsScale
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
......
......@@ -28,7 +28,7 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_ConstrainProportionsScale: 1
m_Children:
- {fileID: 6336379805126431823}
- {fileID: 8883719890140451955}
......@@ -49,6 +49,7 @@ MonoBehaviour:
health: 1
destroyMode: 0
stateChangePrefab: {fileID: 0}
breakScore: 0
--- !u!1001 &7361496486615608284
PrefabInstance:
m_ObjectHideFlags: 0
......@@ -181,6 +182,8 @@ MonoBehaviour:
currentTime: 0
currentPoints: 0
doneMoving: 0
startWait: 3
startTime: 0
firstForceMultiplier: 1
--- !u!1001 &8990285817164968856
PrefabInstance:
......
This diff is collapsed.
......@@ -73,7 +73,7 @@ public void Damage(float damage)
Instantiate(states[stateIndex], oldTransform.position, oldTransform.rotation, this.transform);
}
if(health == 0)
if(health <= 0)
{
parentOfThis = this.gameObject.transform.parent.gameObject;
......
......@@ -123,7 +123,9 @@ public static IEnumerator AddScore(PointTracker source, float basePoints)
while(points > 0)
{
currentComboPoints ++; points --;
currentComboPoints +=100; points -=100;
yield return new WaitForFixedUpdate();
}
......@@ -137,7 +139,7 @@ public IEnumerator TallyScore()
while(currentComboPoints > 0)
{
score ++; currentComboPoints --;
score +=100; currentComboPoints -=100;
yield return new WaitForFixedUpdate();;
}
}
......
......@@ -43,7 +43,7 @@ public void Damage(float damage)
//Maybe we want a cracked material on it if its damaged but won't break, we would do that here
}
GM.instantPoints(breakScore);
GM.instantPoints(breakScore * 100);
}
}
......
......@@ -22,7 +22,7 @@ public class ObjectPoints : MonoBehaviour
[HideInInspector] public bool doneMoving = false;
private bool beenMoved = false;
private bool settled = false;
public float startWait = 3f;
private float startWait = 3f;
public float startTime = 0;
[Range(1f, 10f)]public float firstForceMultiplier = 1f;
......@@ -69,8 +69,8 @@ void Update()
myBod.velocity *= firstForceMultiplier;
}
currentPoints = myBod.mass * distanceTraveled * pointMultiplier;
if (currentPoints > maxPoints) { currentPoints = maxPoints; doneMoving = true; }
currentPoints = myBod.mass * distanceTraveled * pointMultiplier*100;
if (currentPoints > maxPoints*100) { currentPoints = maxPoints; doneMoving = true; }
}
if (dist > minDistance && currentTime > 0 && !doneMoving) { currentTime = 0; }
......
......@@ -48,6 +48,10 @@ void OnTriggerEnter(Collider col)
var distScale = (slamRadius - Vector3.Distance(bod.transform.position, transform.position)) / slamRadius;
bod.AddForce(dir * impactSpeed * distScale * slamForce);
bod.velocity = Vector3.ClampMagnitude(bod.velocity, slamMaxSpeed);
if (col.GetComponentInParent<ObjectHealth>()!= null)
{
col.GetComponentInParent<ObjectHealth>().Damage(distScale * impactSpeed * slamForce);
}
}
}
}
......
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