Commit 08677103 authored by Mitchie Maluschnig's avatar Mitchie Maluschnig
Browse files

Merge branch 'piethrowing'

# Conflicts:
#	RingMaster/RingMaster/.vs/RingMaster/xs/UserPrefs.xml
parents 785f46a8 eca6c009
fileFormatVersion: 2
guid: f109c089d6fdb5f479e7616c3a8df948
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
......@@ -36,8 +36,8 @@ Transform:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1202179348292156}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -8, y: 0, z: 0}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -8.71, y: -3.65, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
......@@ -89,6 +89,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: eb3befb4f15a547e8bff90fa39004e23, type: 3}
m_Name:
m_EditorClassIdentifier:
force: 0
minForce: 4
maxForce: 8
--- !u!212 &212945997560978764
SpriteRenderer:
m_ObjectHideFlags: 1
......@@ -124,7 +127,7 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 8114e20b9ad01408aa51b3d24d23c01b, type: 3}
m_Sprite: {fileID: 21300000, guid: 0b8ef5caf917b91458ec8edc45766835, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1681885780994998}
m_IsPrefabAsset: 1
--- !u!1 &1681885780994998
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 4746125468523812}
- component: {fileID: 212955272991404522}
m_Layer: 0
m_Name: platform
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4746125468523812
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1681885780994998}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.68, y: -1.51, z: -0.046875}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &212955272991404522
SpriteRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1681885780994998}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -1106870113
m_SortingLayer: 1
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 13d6cbcacaf0783479a32a5128174043, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5, y: 0.86}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
fileFormatVersion: 2
guid: a4fd084d2373173479c0c947fd66e9ca
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1001 &100100000
Prefab:
m_ObjectHideFlags: 1
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications: []
m_RemovedComponents: []
m_SourcePrefab: {fileID: 0}
m_RootGameObject: {fileID: 1010547747629248}
m_IsPrefabAsset: 1
--- !u!1 &1010547747629248
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
serializedVersion: 6
m_Component:
- component: {fileID: 4016853487692816}
- component: {fileID: 212452611458889896}
m_Layer: 0
m_Name: pole
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4016853487692816
Transform:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1010547747629248}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 8.650524, y: -4.346783, z: 0.046875}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &212452611458889896
SpriteRenderer:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 1010547747629248}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 4294967295
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 20ccf9db820ab1649af046e2f63d34a0, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 5, y: 0.86}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
fileFormatVersion: 2
guid: b2f35ec24acb33f4eaa815ee25fe06ba
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e2e8c3bab127348c5ab845ce853f4caf
guid: 1301b50af2797864398df1640fd2e3aa
DefaultImporter:
externalObjects: {}
userData:
......
......@@ -58,4 +58,5 @@ public class PauseMenu : MonoBehaviour {
Time.timeScale = 1;
SceneManager.LoadScene("MainMenu");
}
}
......@@ -15,7 +15,7 @@ public class PerformanceMenu : MonoBehaviour {
}
public void MimeMime() {
SceneManager.LoadScene("Particle Tests");
SceneManager.LoadScene("MimeMime");
}
public void SimonSays() {
......
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class MovingTarget : MonoBehaviour {
public float posChangeSpeed, maxPos, minPos;
public static float currentPos = 8f;
public static float previousPos = 8f;
void Start()
{
previousPos = -9f;
if (gameObject.activeSelf){
PieTarget[] targets = gameObject.transform.parent.GetComponentsInChildren<PieTarget>();
for (int i = 0; i < gameObject.transform.parent.childCount; i++)
{
targets[i].gameObject.SetActive(false);
}
}
gameObject.SetActive(true);
}
// Update is called once per frame
void Update()
{
if (currentPos >= minPos && currentPos < maxPos && currentPos > previousPos)
{
gameObject.transform.position = new Vector3(currentPos, -3.65f, 0);
previousPos = currentPos;
currentPos += (posChangeSpeed * Time.deltaTime);
}
else if (currentPos <= maxPos && currentPos > minPos && currentPos < previousPos)
{
gameObject.transform.position = new Vector3(currentPos, -3.65f, 0);
previousPos = currentPos;
currentPos -= (posChangeSpeed * Time.deltaTime);
}
else if (currentPos > previousPos)
{
gameObject.transform.position = new Vector3(currentPos, -3.65f, 0);
previousPos = currentPos;
currentPos -= (posChangeSpeed * Time.deltaTime);
}
else if (currentPos < previousPos)
{
gameObject.transform.position = new Vector3(currentPos, -3.65f, 0);
previousPos = currentPos;
currentPos += (posChangeSpeed * Time.deltaTime);
}
}
}
fileFormatVersion: 2
guid: 1a8f5a68b95cfc0429f6f5a25d89152e
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
......@@ -12,22 +12,22 @@ public class Needle : MonoBehaviour {
void Update()
{
if (PieManager.pieCount > 0)
{
if (Input.GetKeyDown("space"))
{
finalAngle = currentAngle;
angleChangeSpeed = 0;
PowerBar.previousPos = -9f;
}
else if (!Input.GetKey("space"))
{
MoveNeedle();
if (PieManager.pieCount > 0)
{
if (Input.GetKeyDown(KeyCode.Space))
{
finalAngle = currentAngle;
angleChangeSpeed = 0;
PowerBar.previousPos = -9f;
}
else if (!Input.GetKey(KeyCode.Space))
{
MoveNeedle();
}
}
}
public void MoveNeedle()
public void MoveNeedle()
{
angleChangeSpeed = 50;
if (currentAngle >= minAngle && currentAngle < maxAngle && currentAngle > previousAngle)
......
......@@ -3,10 +3,14 @@ using System.Collections.Generic;
using UnityEngine;
public class Pie : MonoBehaviour {
[HideInInspector]
public float force;// an number from zero to one determining the force on the pie
public float minForce = 4f;
public float maxForce = 8f;
// Use this for initialization
void Start () {
// Use this for initialization
void Start () {
Launch();
}
......@@ -27,11 +31,13 @@ public class Pie : MonoBehaviour {
private void Update()
{
}
void Launch(){
Vector3 direction = Quaternion.AngleAxis(Needle.finalAngle, Vector3.forward) * Vector3.right;
gameObject.GetComponent<Rigidbody2D>().AddForce(direction * (4 + (PowerBar.finalPos+2))*100);
//Vector3 direction = Quaternion.AngleAxis(Needle.finalAngle, Vector3.forward) * Vector3.right;
float forceAmmount = (force * (maxForce - minForce)) + minForce;
//print(forceAmmount);
gameObject.GetComponent<Rigidbody2D>().AddForce(transform.up * forceAmmount * 100);
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.SceneManagement;
public class PieManager : MonoBehaviour {
public static int pieCount = 3;
public static int pieCount;
public static bool pieInScene = false;
public static bool start = true;
public static int numTargets;
public Text exitText;
public Text exitTimer;
private void Update()
{
private bool gameOver;
private float exitTime;
private void Update()
{
if(pieCount == 0){
return;
}
if (!gameOver) {
gameOver = true;
exitTime = Time.time + 5;
exitText.gameObject.SetActive(true);
}
}
if (gameOver) {
if (Time.time > exitTime) {
SceneManager.LoadScene("Daytime");
} else {
exitTimer.text = ((int)(exitTime - Time.time + 0.98f)).ToString();
}
}
}
void Start()
{
exitText.gameObject.SetActive(false);
exitTime = Mathf.Infinity;
numTargets = Random.Range(1, 9);
pieCount = numTargets * 2;
PieTarget[] targets = FindObjectsOfType<PieTarget>();
for (int i = 0; i < 9 - numTargets; i++)
{
int n;
do
{
n = Random.Range(0, 9);
} while (targets[n].gameObject.activeSelf == false);
targets[n].gameObject.SetActive(false);
}
//targets[0].gameObject.SetActive(false);
//gameObject.transform.GetComponent<MovingTarget>().gameObject.SetActive(true);
}
}
......@@ -3,11 +3,8 @@ using System.Collections.Generic;
using UnityEngine;
public class PieTarget : MonoBehaviour {
// Update is called once per frame
void Update () {
}
private void OnTriggerEnter2D(Collider2D collision)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment