tutorial completed

This commit is contained in:
unknown 2015-08-16 19:12:46 -04:00
parent 91faee41f2
commit 0adaf2487c
5 changed files with 44 additions and 15 deletions

View File

@ -27,6 +27,7 @@ namespace DeathBook.Model
private float globalAwareness; //on a scale from 0 to 1
public float GlobalAwareness { get { return globalAwareness; } }
public int tutorialInt = 0;
public bool allowNext = true;
private GameStrategy strategy = null;
public GameStrategy Strategy { get { return strategy; } }

View File

@ -104,11 +104,15 @@ namespace DeathBook.Model
public bool Kill()
{
if (Online)
if (Online || (LevelManager.Instance.GameLevel.tutorialInt < 4))
return false;
//Debug.Log("Person " + id + " died!");
alive = false;
if (LevelManager.Instance.GameLevel.tutorialInt == 4)
LevelManager.Instance.GameLevel.allowNext = true;
foreach (Friendship f in friendsList)
f.Other.NotifyFriendWasKilled();
NotifyObservers();

View File

@ -42,14 +42,15 @@ public class NetworkingSphere : MonoBehaviour
private PersonNode _selectedNode;
private float _timeSinceLastClick;
private Level lvl;
// Used to disable the physics when the user has clicked on a node
private bool _isRotatingTowardsNode = false;
void Awake()
{
manager = LevelManager.Instance;
Level lvl = manager.NewLevel(levelOptions.NumPeople, levelOptions.AvgNumFriends, levelOptions.FriendshipLikeliness, levelOptions.SphereRadius, strategy);
lvl = manager.NewLevel(levelOptions.NumPeople, levelOptions.AvgNumFriends, levelOptions.FriendshipLikeliness, levelOptions.SphereRadius, strategy);
InstantiateNodes(lvl);
AssignLinks(lvl);
rb = GetComponent<Rigidbody>();
@ -97,8 +98,12 @@ public class NetworkingSphere : MonoBehaviour
delta = new Vector3();
}
if ((dragging && !_isRotatingTowardsNode)) // && ((lvl.tutorialCount == 0) || (lvl.tutorialCount == 1))
if ((dragging && !_isRotatingTowardsNode))
{
if (lvl.tutorialInt == 1)
{
lvl.allowNext = true;
}
MoveSphere();
}
@ -150,6 +155,9 @@ public class NetworkingSphere : MonoBehaviour
private void OnNodeClicked(PersonNode node)
{
if (lvl.tutorialInt == 2)
lvl.allowNext = true;
rb.angularVelocity = Vector3.zero;
if (_selectedNode != null)
@ -159,6 +167,7 @@ public class NetworkingSphere : MonoBehaviour
if (!_isRotatingTowardsNode || node != _selectedNode)
{
if (lvl.tutorialInt > 1)
FocusOnNode(node);
}
@ -196,6 +205,7 @@ public class NetworkingSphere : MonoBehaviour
public void FocusOnNode(PersonNode node)
{
StopCoroutine("RotateTowardsNodeCoroutine");
StartCoroutine("RotateTowardsNodeCoroutine", node);

View File

@ -5,14 +5,12 @@ using DeathBook.Model;
public class TutorialScript : MonoBehaviour {
//public int tutorialInt = 0;
public GameObject panel;
public Text tutorialText;
public Button btnNext;
private Level lvl;
// Use this for initialization
void Start()
{
lvl = LevelManager.Instance.GameLevel;
@ -21,12 +19,16 @@ public class TutorialScript : MonoBehaviour {
void Update() {
btnNext.enabled = lvl.allowNext;
if (lvl.tutorialInt == 0)
{
Time.timeScale = 0;
tutorialText.text = "The facebook servers are full!\nMark Zuckerberg hired you, Death, to kill off a few of his users.\nCareful, or you might scare them away from Mark's website...";
//btnNext.onClick
lvl.allowNext = true;
tutorialText.text = "The facebook servers are full!\nMark Zuckerberg hired you, Death, to kill off a few of his users.\n\nCareful, or you might scare them away from Mark's website...";
}
else if (lvl.tutorialInt == 1)
{
@ -34,7 +36,7 @@ public class TutorialScript : MonoBehaviour {
}
else if (lvl.tutorialInt == 2)
{
tutorialText.text = "Move around by clicking on the users in the network!";
tutorialText.text = "Move around by left clicking on the users in the network!";
}
else if (lvl.tutorialInt == 3)
{
@ -42,7 +44,13 @@ public class TutorialScript : MonoBehaviour {
}
else if (lvl.tutorialInt == 4)
{
tutorialText.text = "Alright, time for our first victim.\nHold the right mouse button over a user until the X appears completely.";
tutorialText.text = "Alright, time for our first victim.\nHold the LEFT mouse button over a user until the X is complete.\nBeware! The user must be offline to be killed!";
tutorialText.text += "\n\nYou can hold the mouse button until the user goes offline.";
}
else if (lvl.tutorialInt == 5)
{
tutorialText.text = "Kill many users to see how the color changes\n\nRemember, as users realize something is wrong with facebook,\nthe entire network will turn red!\n\nHaveFun!";
lvl.allowNext = true;
}
else
{
@ -54,10 +62,12 @@ public class TutorialScript : MonoBehaviour {
public void btnClick()
{
lvl.tutorialInt++;
Debug.Log(lvl.tutorialInt + ", aasfasf");
//Debug.Log(lvl.tutorialInt + ", aasfasf");
Time.timeScale = 1;
tutorialText.text = "eee";
lvl.allowNext = false;
//panel.transform.Translate(Vector3.right * 100);
}

View File

@ -7,6 +7,7 @@ using UnityEngine.UI;
public class UIFriendPicture : MonoBehaviour
{
private Person _model;
private Level lvl;
public Person Model
{
@ -23,11 +24,14 @@ public class UIFriendPicture : MonoBehaviour
void Awake()
{
lvl = LevelManager.Instance.GameLevel;
_picture = GetComponent<Image>();
}
public void OnClick()
{
if (lvl.tutorialInt == 3)
lvl.allowNext = true;
_model.SelectNode();
_model.SelectNode();
}