Skip to content
Snippets Groups Projects
Commit 63c1c683 authored by Michael LaFreniere's avatar Michael LaFreniere
Browse files

Merge remote-tracking branch 'origin/master'

parents 55936bbf 7c28c569
No related branches found
No related tags found
No related merge requests found
Showing
with 135 additions and 58 deletions
No preview for this file type
No preview for this file type
......@@ -16,33 +16,48 @@ public class EnterDoor : MonoBehaviour {
player.transform.position = spawnPoint[spawnPointIndex].position;
}
// when creating extra doors, add spawnPoint[] in correct order in the inspector.
void OnTriggerEnter2D(Collider2D collider) {
if (this.CompareTag("Church")) {
void OnTriggerEnter2D(Collider2D collider)
{
if (this.CompareTag("Church"))
{
spawnPointIndex = 0;
Debug.Log("The index is:" + spawnPointIndex);
}
else if (this.CompareTag("Blacksmith")) {
else if (this.CompareTag("Blacksmith"))
{
spawnPointIndex = 1;
Debug.Log("The index is:" + spawnPointIndex);
}
else if (this.CompareTag("Arena")) {
else if (this.CompareTag("Arena"))
{
spawnPointIndex = 2;
Debug.Log("The index is:" + spawnPointIndex);
}
else if (this.CompareTag("MainSpawn")) {
else if (this.CompareTag("MainSpawn"))
{
spawnPointIndex = 3;
Debug.Log("The index is:" + spawnPointIndex);
}
else if (this.CompareTag("NextTown"))
{
spawnPointIndex = 4;
Debug.Log("The index is:" + spawnPointIndex);
}
if (collider.CompareTag("Player") && spawnPointIndex != 3) {
if (collider.CompareTag("Player") && spawnPointIndex != 3)
{
doorText.text = ("Press [F] to Enter");
if (Input.GetKeyDown("f")) {
if (Input.GetKeyDown("f"))
{
SceneManager.LoadScene(sceneName);
}
}
if (collider.CompareTag("Player") && spawnPointIndex == 4)
{
doorText.text = ("TO THE NEXT TOWN");
SceneManager.LoadScene(sceneName);
}
}
void OnTriggerStay2D(Collider2D collider) {
if (collider.tag == "Player" && spawnPointIndex != 3) {
if (Input.GetKeyDown("f")) {
......
using UnityEngine;
using System.Collections;
public class InBetweenAI : MonoBehaviour {
private Animator myAnimator;
private Transform target;
private float speed = 3;
bool moveallowed = false;
double[] heights = { -1.40, 1, 3.12, 5.33, 7.58 };
// Use this for initialization
// Use this for initialization
void Start () {
target = GameObject.FindGameObjectWithTag("Player").transform;
}
// Update is called once per frame
void Update () {
myAnimator = GetComponent<Animator>();
move();
}
public void move()
{
if (moveallowed)
{
Debug.Log("moving");
//rotate to look at the player
//transform.LookAt(target.position);
myAnimator.SetFloat("speed", 1); // This should probbaly reflect the actual speed
transform.position = Vector2.MoveTowards(transform.position, target.transform.position, speed * Time.deltaTime);
if (target.transform.position.x <= transform.position.x) //players spot in world space as opposed to enemy "self" spot
{
transform.rotation = new Quaternion(0, 180, 0, 0); // flips enemy around to face the player on x axis only
}
else if (target.transform.position.x >= transform.position.x) //players spot in world space as opposed to enemy "self" spot
{
transform.rotation = new Quaternion(0, 0, 0, 0); // flips enemy around to face the player on x axis only }
}
if(Vector3.Distance(transform.position, target.transform.position) < 1 )
{
moveallowed = false;
Debug.Log("collide");
//load combat scene
}
}
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.name == "Player")
{
moveallowed = true;
}
}
}
using UnityEngine;
using System.Collections;
public class InBetweenCamera : MonoBehaviour
{
public Transform follow;
Camera cam;
// Use this for initialization
void Start()
{
cam = GetComponent<Camera>();
}
// Update is called once per frame
void Update()
{
//changing screen height won't screw the sprites. (mobile capatability, etc.)
cam.orthographicSize = (Screen.height / 100f);
//Lerp parameters (from, to, how fast)
if (follow)
{
transform.position = Vector3.Lerp(transform.position, follow.position, 0.1f) + new Vector3(0, .1f, -10);
}
}
}
......@@ -3,13 +3,25 @@ using System.Collections;
public class RandomPlatforms : MonoBehaviour {
GameObject platform;
GameObject enemy;
int numPlatforms, ranIndex, numEnemies;
double[] heights = {-1.39, 0.9, 3.11, 5.32, 7.57 };
// Use this for initialization
void Start () {
platform = GameObject.Find("platform");
numPlatforms = Random.Range(30, 200);
enemy = GameObject.Find("Enemy");
numEnemies = Random.Range(10, 30);
for(int i = 0; i < numPlatforms; i++) {
ranIndex = Random.Range(0, 5);
GameObject platformapus = Instantiate(platform, new Vector3( Random.Range(-20, 124), (float)heights[ranIndex], 10), Quaternion.identity) as GameObject;
}
for (int i = 0; i < numEnemies; i++)
{
ranIndex = Random.Range(0, 5);
GameObject enenemenenies = Instantiate(enemy, new Vector2(Random.Range(-10, 124), (float)heights[ranIndex]), Quaternion.identity) as GameObject;
}
}
// Update is called once per frame
void Update () {
}
}
}
fileFormatVersion: 2
guid: 21a3c448383989d42b84da4d100a3d89
timeCreated: 1480097067
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
No preview for this file type
sceneSetups:
<<<<<<< HEAD
- path: Assets/Scenes/shopBlacksmith.unity
=======
- path: Assets/Scenes/Town01ToTown02.unity
>>>>>>> origin/master
isLoaded: 1
isActive: 1
File deleted
<?xml version="1.0"?>
<doc>
<assembly>
<name>UnityEditor.iOS.Extensions.Common</name>
</assembly>
<members>
<member name="T:UnityEditor.iOS.BuildPipeline">
<summary>Lets you programmatically build players or AssetBundles which can be loaded from the web.</summary>
</member>
<member name="T:UnityEditor.iOS.DeviceType">
<summary>Enumeration for SystemInfo.deviceType, denotes a coarse grouping of kinds of devices.</summary>
</member>
</members>
</doc>
File deleted
<?xml version="1.0"?>
<doc>
<assembly>
<name>UnityEditor.iOS.Extensions.Xcode</name>
</assembly>
<members>
</members>
</doc>
......@@ -3,6 +3,4 @@ StandaloneWindows
C:/Program Files/Unity/Editor/Data/Managed/UnityEngine.dll
C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll
C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll
C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll
C:/Program Files/Unity/Editor/Data/PlaybackEngines/iOSSupport\UnityEditor.iOS.Extensions.Xcode.dll
C:/Program Files/Unity/Editor/Data/PlaybackEngines/iOSSupport\UnityEditor.iOS.Extensions.Common.dll
\ No newline at end of file
C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.dll
\ No newline at end of file
No preview for this file type
No preview for this file type
No preview for this file type
......@@ -61,12 +61,6 @@
<Reference Include="UnityEditor">
<HintPath>Library\UnityAssemblies\UnityEditor.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Xcode">
<HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Xcode.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.iOS.Extensions.Common">
<HintPath>Library\UnityAssemblies\UnityEditor.iOS.Extensions.Common.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\Scripts\ArenaCombatControl.cs" />
......@@ -78,7 +72,9 @@
<Compile Include="Assets\Scripts\EnemyAI.cs" />
<Compile Include="Assets\Scripts\EnemyHealth.cs" />
<Compile Include="Assets\Scripts\EnterDoor.cs" />
<Compile Include="Assets\Scripts\ForceEnterDoor.cs" />
<Compile Include="Assets\Scripts\InBetween.cs" />
<Compile Include="Assets\Scripts\InBetweenCamera.cs" />
<Compile Include="Assets\Scripts\MainMenu.cs" />
<Compile Include="Assets\Scripts\Money.cs" />
<Compile Include="Assets\Scripts\PlayerHealth.cs" />
......
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