Commit cb2279c5 authored by Eby Komenan's avatar Eby Komenan

Merge remote-tracking branch 'origin/master' into Birbbase

parents e6747f5f 49e9c0b7
fileFormatVersion: 2
guid: 2057902e730664aacbc88367b9c3b892
guid: d31ebdd80916bea45bd33409fe585333
folderAsset: yes
timeCreated: 1486687237
timeCreated: 1486686817
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
assetBundleVariant:
\ No newline at end of file
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class GameManager : SingletonBehaviour<GameManager>
{
private bool _isPaused;
//Manages game state. Pause, death, win, and changing levels.
public bool isPaused
{
get
{
return _isPaused;
}
set
{
_isPaused = value;
if (isPaused)
{
//set timescale back to normal
isPaused = false;
Debug.Log("Game is unpaused");
}
else
{
//set timescale to zero
isPaused = true;
Debug.Log("Game is paused");
}
}
}
public void Fail()
{
Debug.Log("You have died");
}
public void Win()
{
Debug.Log("You won!");
}
public void ChangeLevel()
{
Debug.Log("Changing level state");
}
}
fileFormatVersion: 2
guid: cad3061263b98c140a9a3a49d70204c9
timeCreated: 1486686808
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Walk : AbstractBehavior {
public int speed;
private float airSpeed;
public float airAcceleration;
// Use this for initialization
void Start() {
}
// Update is called once per frame
void Update() {
Buttons left = inputButtons[0];
Buttons right = inputButtons[1];
int rightInt = 0;
int leftInt = 0;
if (inputState.GetButtonValue(right))
rightInt = 1;
else
rightInt = 0;
if (inputState.GetButtonValue(left))
leftInt = -1;
else
leftInt = 0;
if (collisionState.onGround)
{
body.velocity = new Vector2(speed * (rightInt + leftInt), body.velocity.y);
} else
{
airSpeed = body.velocity.x;
if (inputState.GetButtonValue(right) || inputState.GetButtonValue(left))
{
airSpeed = Mathf.Clamp(airSpeed + airAcceleration * (rightInt + leftInt), -speed, speed);
}
else
{
if (airSpeed != 0) {
airSpeed += (-1) * Mathf.Sign(airSpeed) * airAcceleration;
if (Mathf.Abs(airSpeed) < airAcceleration)
airSpeed = 0;
}
}
body.velocity = new Vector2(airSpeed, body.velocity.y);
}
}
}
fileFormatVersion: 2
guid: fffc5061cced9b8498b9146e0712c85e
timeCreated: 1486687201
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Hazard : MonoBehaviour {
void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
other.GetComponent<Birb>().Die ();
}
}
}
fileFormatVersion: 2
guid: 763513e1173772545a16c3cb1a4d40d5
timeCreated: 1486688527
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WinTrigger : MonoBehaviour {
//checks for incoming collision
public void OnTriggerEnter2D(Collider2D other)
{
if(other.gameObject.name == "Player") //ensuring it's the player
{
//tell manager it has won
GameEditor.Win();
//Debug.Log("Victory Achieved");
}
}
}
fileFormatVersion: 2
guid: 79af5acd6c178454090143472b307c76
timeCreated: 1486692331
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
<<<<<<< Updated upstream
m_EditorVersion: 5.5.0f3
=======
m_EditorVersion: 5.5.1f1
>>>>>>> Stashed changes
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