@ -0,0 +1,127 @@ | |||
fileFormatVersion: 2 | |||
guid: 23756e737f935a140810973e4e080871 | |||
ModelImporter: | |||
serializedVersion: 16 | |||
fileIDToRecycleName: | |||
100000: //RootNode | |||
100002: pCube1 | |||
100004: pTorus1 | |||
100006: pTorus10 | |||
100008: pTorus11 | |||
100010: pTorus12 | |||
100012: pTorus13 | |||
100014: pTorus2 | |||
100016: pTorus3 | |||
100018: pTorus4 | |||
100020: pTorus5 | |||
100022: pTorus6 | |||
100024: pTorus8 | |||
100026: pTorus9 | |||
400000: //RootNode | |||
400002: pCube1 | |||
400004: pTorus1 | |||
400006: pTorus10 | |||
400008: pTorus11 | |||
400010: pTorus12 | |||
400012: pTorus13 | |||
400014: pTorus2 | |||
400016: pTorus3 | |||
400018: pTorus4 | |||
400020: pTorus5 | |||
400022: pTorus6 | |||
400024: pTorus8 | |||
400026: pTorus9 | |||
2300000: pCube1 | |||
2300002: pTorus1 | |||
2300004: pTorus10 | |||
2300006: pTorus11 | |||
2300008: pTorus12 | |||
2300010: pTorus13 | |||
2300012: pTorus2 | |||
2300014: pTorus3 | |||
2300016: pTorus4 | |||
2300018: pTorus5 | |||
2300020: pTorus6 | |||
2300022: pTorus8 | |||
2300024: pTorus9 | |||
3300000: pCube1 | |||
3300002: pTorus1 | |||
3300004: pTorus10 | |||
3300006: pTorus11 | |||
3300008: pTorus12 | |||
3300010: pTorus13 | |||
3300012: pTorus2 | |||
3300014: pTorus3 | |||
3300016: pTorus4 | |||
3300018: pTorus5 | |||
3300020: pTorus6 | |||
3300022: pTorus8 | |||
3300024: pTorus9 | |||
4300000: pCube1 | |||
4300002: pTorus1 | |||
4300004: pTorus2 | |||
4300006: pTorus3 | |||
4300008: pTorus4 | |||
4300010: pTorus5 | |||
4300012: pTorus6 | |||
4300014: pTorus8 | |||
4300016: pTorus9 | |||
4300018: pTorus10 | |||
4300020: pTorus11 | |||
4300022: pTorus12 | |||
4300024: pTorus13 | |||
9500000: //RootNode | |||
materials: | |||
importMaterials: 1 | |||
materialName: 0 | |||
materialSearch: 1 | |||
animations: | |||
legacyGenerateAnimations: 4 | |||
bakeSimulation: 0 | |||
optimizeGameObjects: 0 | |||
motionNodeName: | |||
animationCompression: 1 | |||
animationRotationError: .5 | |||
animationPositionError: .5 | |||
animationScaleError: .5 | |||
animationWrapMode: 0 | |||
extraExposedTransformPaths: [] | |||
clipAnimations: [] | |||
isReadable: 1 | |||
meshes: | |||
lODScreenPercentages: [] | |||
globalScale: .00999999978 | |||
meshCompression: 0 | |||
addColliders: 0 | |||
importBlendShapes: 1 | |||
swapUVChannels: 0 | |||
generateSecondaryUV: 0 | |||
useFileUnits: 1 | |||
optimizeMeshForGPU: 1 | |||
weldVertices: 1 | |||
secondaryUVAngleDistortion: 8 | |||
secondaryUVAreaDistortion: 15.000001 | |||
secondaryUVHardAngle: 88 | |||
secondaryUVPackMargin: 4 | |||
tangentSpace: | |||
normalSmoothAngle: 60 | |||
splitTangentsAcrossUV: 1 | |||
normalImportMode: 0 | |||
tangentImportMode: 1 | |||
importAnimation: 1 | |||
copyAvatar: 0 | |||
humanDescription: | |||
human: [] | |||
skeleton: [] | |||
armTwist: .5 | |||
foreArmTwist: .5 | |||
upperLegTwist: .5 | |||
legTwist: .5 | |||
armStretch: .0500000007 | |||
legStretch: .0500000007 | |||
feetSpacing: 0 | |||
rootMotionBoneName: | |||
lastHumanDescriptionAvatarSource: {instanceID: 0} | |||
animationType: 2 | |||
additionalBone: 0 | |||
userData: |
@ -0,0 +1,5 @@ | |||
fileFormatVersion: 2 | |||
guid: fb9b0f999f81a7a47b113adc8c0d8d8e | |||
folderAsset: yes | |||
DefaultImporter: | |||
userData: |
@ -0,0 +1,4 @@ | |||
fileFormatVersion: 2 | |||
guid: 6b96e1a2024a3434ca84415e0bdba2bc | |||
NativeFormatImporter: | |||
userData: |
@ -1,21 +0,0 @@ | |||
using UnityEngine; | |||
using System.Collections; | |||
public class P2_weapon : MonoBehaviour { | |||
// Use this for initialization | |||
void Start () { | |||
} | |||
void Update (){ | |||
if (Input.GetKeyDown("space")) | |||
transform.Translate (Vector3.right); | |||
else if (Input.GetKeyUp("space")) | |||
transform.Translate (Vector3.left); | |||
} | |||
// Update is called once per frame | |||
} |
@ -1,8 +0,0 @@ | |||
fileFormatVersion: 2 | |||
guid: f348d28f3452e574c9fe07574e3ca5ee | |||
MonoImporter: | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: |
@ -1,115 +0,0 @@ | |||
using UnityEngine; | |||
using System.Collections; | |||
public class PlayerControler : MonoBehaviour { | |||
public Animator animator; | |||
// Use this for initialization | |||
void Start () { | |||
} | |||
public float speed; | |||
public Vector2 jumpVector; | |||
public int health = 0; | |||
private int displayedHealth = 0; | |||
private bool updateHealth = false; | |||
private float curDirection = -1; | |||
public GameObject bullet; | |||
public GameObject heart; | |||
bool canJump = true; | |||
public GameObject newConfetti; | |||
void Update() { | |||
Vector2 velo = rigidbody2D.velocity; | |||
velo.x = Input.GetAxis ("Horizontal_P1") * speed; | |||
rigidbody2D.velocity = velo; | |||
animator.SetFloat("Velocity",velo.magnitude); | |||
animator.SetBool ("Fall", !canJump); | |||
if (curDirection != Input.GetAxisRaw ("Horizontal_P1")) | |||
applyPlayerDirection (Input.GetAxisRaw ("Horizontal_P1")); | |||
if (displayedHealth != health) { | |||
updateHealth = true; | |||
} | |||
if (updateHealth) | |||
displayHealth (health); | |||
if (health == 0) | |||
death(); | |||
if (Input.GetKey (KeyCode.UpArrow)){ | |||
if (canJump == true){ | |||
rigidbody2D.velocity = jumpVector; | |||
canJump = false; | |||
} | |||
} | |||
//if (Input.GetKey (KeyCode.Space)){ | |||
//shoot | |||
//GameObject bulletGO = Instantiate (bullet) as GameObject; | |||
//bulletGO.transform.position = transform.position; | |||
//} | |||
} | |||
private void displayHealth(int health){ | |||
GameObject[] hearts = GameObject.FindGameObjectsWithTag("heartUI2"); | |||
foreach (GameObject desHeart in hearts) | |||
GameObject.Destroy (desHeart); | |||
for (int i=1; i<= health; i++) { | |||
GameObject heartCanister = Instantiate (heart) as GameObject; | |||
Vector3 heartPos = new Vector3 (1-(i * 0.033f), 0.95f, 0); | |||
heartCanister.transform.position = heartPos; | |||
} | |||
displayedHealth = health; | |||
updateHealth = false; | |||
} | |||
private void applyPlayerDirection(float moveHorizontal) | |||
{ | |||
if (moveHorizontal != 0) | |||
{ | |||
transform.Rotate(0,180,0); | |||
curDirection = moveHorizontal; | |||
} | |||
} | |||
private void Confettishoot(Vector3 target,float size){ | |||
Debug.Log ("Creating Confetti"); | |||
target.y += 1.5f; | |||
for (int i = 0; i <size; i++) { | |||
Instantiate (newConfetti, target, transform.rotation); | |||
} | |||
} | |||
private void death(){ | |||
if (health == 0) { | |||
Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); | |||
health = 3; | |||
transform.position = spawnPos; | |||
rigidbody2D.velocity = Vector2.zero; | |||
} | |||
} | |||
void OnCollisionEnter2D(Collision2D col){ | |||
if (col.collider.tag == "ground") | |||
canJump = true; | |||
else if (col.collider.tag == "Player") { | |||
canJump = true; | |||
if(transform.position.y>col.transform.position.y){ | |||
col.gameObject.GetComponent<player2_controls>().health --; | |||
Confettishoot(col.gameObject.transform.position,20.0f); | |||
//health --; | |||
rigidbody2D.velocity = jumpVector; | |||
canJump = false; | |||
} | |||
} | |||
} | |||
} |
@ -0,0 +1,43 @@ | |||
using UnityEngine; | |||
using System.Collections; | |||
public class collectable : MonoBehaviour { | |||
// Use this for initialization | |||
void Start () { | |||
float rand = Random.Range (0, 7); | |||
int randColour = Mathf.FloorToInt (rand); | |||
switch (randColour) { | |||
case 0: | |||
renderer.material.color = Color.cyan; | |||
break; | |||
case 1: | |||
renderer.material.color = Color.red; | |||
break; | |||
case 2: | |||
renderer.material.color = Color.blue; | |||
break; | |||
case 3: | |||
renderer.material.color = Color.green; | |||
break; | |||
case 4: | |||
renderer.material.color = Color.yellow; | |||
break; | |||
case 5: | |||
renderer.material.color = Color.magenta; | |||
break; | |||
default: | |||
renderer.material.color = Color.black; | |||
break; | |||
} | |||
} | |||
// Update is called once per frame | |||
void Update () { | |||
transform.Rotate (new Vector3 (15, 30, 45) * Time.deltaTime); | |||
} | |||
} |
@ -1,5 +1,5 @@ | |||
fileFormatVersion: 2 | |||
guid: 2f110149822ba46b39723c6d01336581 | |||
guid: de1432d88ba03a641ab648872aee7e07 | |||
MonoImporter: | |||
serializedVersion: 2 | |||
defaultReferences: [] |
@ -1,116 +0,0 @@ | |||
using UnityEngine; | |||
using System.Collections; | |||
public class player2_controls : MonoBehaviour { | |||
public Animator animator; | |||
void Start () { | |||
} | |||
public float speed; | |||
public Vector2 jumpVector; | |||
public int health = 0; | |||
private int displayedHealth = 0; | |||
private bool updateHealth = false; | |||
private float curDirection = 1; | |||
public GameObject bullet; | |||
public GameObject heart; | |||
bool canJump = true; | |||
public string HorizontalBtn; | |||
public GameObject newConfetti; | |||
//Horizontal_P2 | |||
void Update() { | |||
Vector2 velo = rigidbody2D.velocity; | |||
velo.x = Input.GetAxis (HorizontalBtn) * speed; | |||
rigidbody2D.velocity = velo; | |||
animator.SetFloat("Velocity",velo.magnitude); | |||
animator.SetBool ("Fall", !canJump); | |||
if (curDirection != Input.GetAxisRaw (HorizontalBtn)) | |||
applyPlayerDirection (Input.GetAxisRaw (HorizontalBtn)); | |||
if (displayedHealth != health) { | |||
updateHealth = true; | |||
} | |||
if (updateHealth) | |||
displayHealth (health); | |||
if (health == 0) | |||
death(); | |||
if (Input.GetKey (KeyCode.W)){ | |||
if (canJump == true){ | |||
rigidbody2D.velocity = jumpVector; | |||
canJump = false; | |||
} | |||
} | |||
//if (Input.GetKey (KeyCode.Space)){ | |||
//shoot | |||
//GameObject bulletGO = Instantiate (bullet) as GameObject; | |||
//bulletGO.transform.posplayteition = transform.position; | |||
//} | |||
} | |||
private void displayHealth(int health){ | |||
GameObject[] hearts = GameObject.FindGameObjectsWithTag("heartUI"); | |||
foreach (GameObject desHeart in hearts) | |||
GameObject.Destroy (desHeart); | |||
for (int i=1; i<= health; i++) { | |||
GameObject heartCanister = Instantiate (heart) as GameObject; | |||
Vector3 heartPos = new Vector3 ((i * 0.033f), 0.95f, 0); | |||
heartCanister.transform.position = heartPos; | |||
} | |||
displayedHealth = health; | |||
updateHealth = false; | |||
} | |||
//Changes direction of sprite according to key pressed | |||
private void applyPlayerDirection(float moveHorizontal) | |||
{ | |||
if (moveHorizontal != 0) | |||
{ | |||
transform.Rotate(0,180,0); | |||
curDirection = moveHorizontal; | |||
} | |||
} | |||
private void Confettishoot(Vector3 target,float size){ | |||
Debug.Log ("Creating Confetti"); | |||
target.y += 1.5f; | |||
for (int i = 0; i <size; i++) { | |||
Instantiate (newConfetti, target, transform.rotation); | |||
} | |||
} | |||
private void death(){ | |||
Vector3 spawnPos = new Vector3 (Random.Range (-20.0f, 20.0f), 15.0f, 0); | |||
health = 3; | |||
transform.position = spawnPos; | |||
} | |||
void OnCollisionEnter2D(Collision2D col){ | |||
if (col.collider.tag == "ground") | |||
canJump = true; | |||
else if (col.collider.tag == "Player") { | |||
if(transform.position.y>col.transform.position.y){ | |||
col.gameObject.GetComponent<PlayerControler>().health --; | |||
Confettishoot(col.gameObject.transform.position,20.0f); | |||
//health --; | |||
rigidbody2D.velocity = jumpVector; | |||
canJump = false; | |||
} | |||
} | |||
} | |||
} |
@ -1,8 +0,0 @@ | |||
fileFormatVersion: 2 | |||
guid: e1ccee01ee999524e8c0e99f0e5ac3d8 | |||
MonoImporter: | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: |
@ -1,16 +0,0 @@ | |||
using UnityEngine; | |||
using System.Collections; | |||
public class sc : MonoBehaviour { | |||
Quaternion rotation; | |||
// Use this for initialization | |||
void Awake () { | |||
rotation = transform.rotation; | |||
} | |||
// Update is called once per frame | |||
void LateUpdate () { | |||
transform.rotation = rotation; | |||
} | |||
} |
@ -1,8 +0,0 @@ | |||
fileFormatVersion: 2 | |||
guid: 8664bb421145d654e8a7367a64b7ca5e | |||
MonoImporter: | |||
serializedVersion: 2 | |||
defaultReferences: [] | |||
executionOrder: 0 | |||
icon: {instanceID: 0} | |||
userData: |