mirror of
https://github.com/ConjureETS/DeathBook.git
synced 2026-03-25 13:00:59 +00:00
Merge branch 'master' of https://github.com/ConjureETS/DeathBook
This commit is contained in:
commit
40bb309d72
1673
Assets/Scenes/Tutoriel.unity
Normal file
1673
Assets/Scenes/Tutoriel.unity
Normal file
File diff suppressed because it is too large
Load Diff
8
Assets/Scenes/Tutoriel.unity.meta
Normal file
8
Assets/Scenes/Tutoriel.unity.meta
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 954690b6e2639f149bb1741d688d2815
|
||||||
|
timeCreated: 1439747828
|
||||||
|
licenseType: Free
|
||||||
|
DefaultImporter:
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -195,8 +195,8 @@ Camera:
|
|||||||
m_GameObject: {fileID: 608195445}
|
m_GameObject: {fileID: 608195445}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_ClearFlags: 1
|
m_ClearFlags: 2
|
||||||
m_BackGroundColor: {r: .192156866, g: .301960796, b: .474509805, a: .0196078438}
|
m_BackGroundColor: {r: 0, g: 0, b: 0, a: .0196078438}
|
||||||
m_NormalizedViewPortRect:
|
m_NormalizedViewPortRect:
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
x: 0
|
x: 0
|
||||||
@ -317,6 +317,7 @@ GameObject:
|
|||||||
- 33: {fileID: 1865312315}
|
- 33: {fileID: 1865312315}
|
||||||
- 64: {fileID: 1865312314}
|
- 64: {fileID: 1865312314}
|
||||||
- 23: {fileID: 1865312313}
|
- 23: {fileID: 1865312313}
|
||||||
|
- 114: {fileID: 1865312317}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Background
|
m_Name: Background
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
@ -379,3 +380,15 @@ Transform:
|
|||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_RootOrder: 3
|
m_RootOrder: 3
|
||||||
|
--- !u!114 &1865312317
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_PrefabParentObject: {fileID: 0}
|
||||||
|
m_PrefabInternal: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 1865312312}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 2931322f1f0c62f40b2d7a6e493934ca, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
timeToWait: 2
|
||||||
|
|||||||
@ -26,6 +26,8 @@ namespace DeathBook.Model
|
|||||||
|
|
||||||
private float globalAwareness; //on a scale from 0 to 1
|
private float globalAwareness; //on a scale from 0 to 1
|
||||||
public float GlobalAwareness { get { return globalAwareness; } }
|
public float GlobalAwareness { get { return globalAwareness; } }
|
||||||
|
public int tutorialInt = 0;
|
||||||
|
public bool allowNext = true;
|
||||||
|
|
||||||
private GameStrategy strategy = null;
|
private GameStrategy strategy = null;
|
||||||
public GameStrategy Strategy { get { return strategy; } }
|
public GameStrategy Strategy { get { return strategy; } }
|
||||||
|
|||||||
@ -104,11 +104,15 @@ namespace DeathBook.Model
|
|||||||
|
|
||||||
public bool Kill()
|
public bool Kill()
|
||||||
{
|
{
|
||||||
if (Online)
|
if (Online || (LevelManager.Instance.GameLevel.tutorialInt < 4))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
//Debug.Log("Person " + id + " died!");
|
//Debug.Log("Person " + id + " died!");
|
||||||
alive = false;
|
alive = false;
|
||||||
|
|
||||||
|
if (LevelManager.Instance.GameLevel.tutorialInt == 4)
|
||||||
|
LevelManager.Instance.GameLevel.allowNext = true;
|
||||||
|
|
||||||
foreach (Friendship f in friendsList)
|
foreach (Friendship f in friendsList)
|
||||||
f.Other.NotifyFriendWasKilled();
|
f.Other.NotifyFriendWasKilled();
|
||||||
NotifyObservers();
|
NotifyObservers();
|
||||||
|
|||||||
@ -42,21 +42,22 @@ public class NetworkingSphere : MonoBehaviour
|
|||||||
private PersonNode _selectedNode;
|
private PersonNode _selectedNode;
|
||||||
private float _timeSinceLastClick;
|
private float _timeSinceLastClick;
|
||||||
|
|
||||||
|
private Level lvl;
|
||||||
|
|
||||||
// Used to disable the physics when the user has clicked on a node
|
// Used to disable the physics when the user has clicked on a node
|
||||||
private bool _isRotatingTowardsNode = false;
|
private bool _isRotatingTowardsNode = false;
|
||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
manager = LevelManager.Instance;
|
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);
|
InstantiateNodes(lvl);
|
||||||
AssignLinks(lvl);
|
AssignLinks(lvl);
|
||||||
rb = GetComponent<Rigidbody>();
|
rb = GetComponent<Rigidbody>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OnGUI()
|
void OnGUI()
|
||||||
{
|
{
|
||||||
int time = manager.GameLevel.DayTime;
|
int time = manager.GameLevel.DayTime;
|
||||||
GUI.Button(new Rect(50, 50, 100, 40), Utils.GetTimeString(time));
|
GUI.Button(new Rect(50, 50, 100, 40), Utils.GetTimeString(time));
|
||||||
GUI.Button(new Rect(160, 50, 100, 40), manager.GameLevel.Awareness + "");
|
GUI.Button(new Rect(160, 50, 100, 40), manager.GameLevel.Awareness + "");
|
||||||
@ -69,7 +70,7 @@ public class NetworkingSphere : MonoBehaviour
|
|||||||
_timeSinceLastClick += Time.deltaTime;
|
_timeSinceLastClick += Time.deltaTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
manager.GameLevel.Update(Time.deltaTime);
|
manager.GameLevel.Update(Time.deltaTime);
|
||||||
|
|
||||||
//TEMPORARY QUICK FIX: Even though we are never moving the sphere, it starts moving as soon as it stops rotating
|
//TEMPORARY QUICK FIX: Even though we are never moving the sphere, it starts moving as soon as it stops rotating
|
||||||
transform.position = Vector3.zero;
|
transform.position = Vector3.zero;
|
||||||
@ -81,7 +82,7 @@ public class NetworkingSphere : MonoBehaviour
|
|||||||
Vector3 worldMousePos = Camera.main.ScreenToWorldPoint(screenMousePos);
|
Vector3 worldMousePos = Camera.main.ScreenToWorldPoint(screenMousePos);
|
||||||
|
|
||||||
// If the world position of the mouse is greater than the radius of the sphere, we are outside
|
// If the world position of the mouse is greater than the radius of the sphere, we are outside
|
||||||
if (Mathf.Sqrt(worldMousePos.x * worldMousePos.x + worldMousePos.y * worldMousePos.y) > levelOptions.SphereRadius + 1f)
|
if (Mathf.Sqrt(worldMousePos.x * worldMousePos.x + worldMousePos.y * worldMousePos.y) > levelOptions.SphereRadius + 1f)
|
||||||
{
|
{
|
||||||
transform.Rotate(Vector3.one * Time.deltaTime * rotationSpeed);
|
transform.Rotate(Vector3.one * Time.deltaTime * rotationSpeed);
|
||||||
}
|
}
|
||||||
@ -97,21 +98,25 @@ public class NetworkingSphere : MonoBehaviour
|
|||||||
delta = new Vector3();
|
delta = new Vector3();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dragging && !_isRotatingTowardsNode)
|
if ((dragging && !_isRotatingTowardsNode))
|
||||||
{
|
{
|
||||||
|
if (lvl.tutorialInt == 1)
|
||||||
|
{
|
||||||
|
lvl.allowNext = true;
|
||||||
|
}
|
||||||
MoveSphere();
|
MoveSphere();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
//scroll
|
//scroll
|
||||||
if (Input.GetAxis("Mouse ScrollWheel") != 0)
|
if (Input.GetAxis("Mouse ScrollWheel") != 0)
|
||||||
{
|
{
|
||||||
// if (Camera.main.ScreenToViewportPoint(Input.mousePosition) < new Vector3(1,1,1))
|
// if (Camera.main.ScreenToViewportPoint(Input.mousePosition) < new Vector3(1,1,1))
|
||||||
if (Camera.main.ScreenToViewportPoint(Input.mousePosition).x < 1)
|
if (Camera.main.ScreenToViewportPoint(Input.mousePosition).x < 1)
|
||||||
{
|
{
|
||||||
Camera.main.fieldOfView -= Input.GetAxis("Mouse ScrollWheel") * 10f;
|
Camera.main.fieldOfView -= Input.GetAxis("Mouse ScrollWheel") * 10f;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveSphere()
|
void MoveSphere()
|
||||||
@ -150,6 +155,9 @@ public class NetworkingSphere : MonoBehaviour
|
|||||||
|
|
||||||
private void OnNodeClicked(PersonNode node)
|
private void OnNodeClicked(PersonNode node)
|
||||||
{
|
{
|
||||||
|
if (lvl.tutorialInt == 2)
|
||||||
|
lvl.allowNext = true;
|
||||||
|
|
||||||
rb.angularVelocity = Vector3.zero;
|
rb.angularVelocity = Vector3.zero;
|
||||||
|
|
||||||
if (_selectedNode != null)
|
if (_selectedNode != null)
|
||||||
@ -159,7 +167,8 @@ public class NetworkingSphere : MonoBehaviour
|
|||||||
|
|
||||||
if (!_isRotatingTowardsNode || node != _selectedNode)
|
if (!_isRotatingTowardsNode || node != _selectedNode)
|
||||||
{
|
{
|
||||||
FocusOnNode(node);
|
if (lvl.tutorialInt > 1)
|
||||||
|
FocusOnNode(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -196,6 +205,7 @@ public class NetworkingSphere : MonoBehaviour
|
|||||||
|
|
||||||
public void FocusOnNode(PersonNode node)
|
public void FocusOnNode(PersonNode node)
|
||||||
{
|
{
|
||||||
|
|
||||||
StopCoroutine("RotateTowardsNodeCoroutine");
|
StopCoroutine("RotateTowardsNodeCoroutine");
|
||||||
StartCoroutine("RotateTowardsNodeCoroutine", node);
|
StartCoroutine("RotateTowardsNodeCoroutine", node);
|
||||||
|
|
||||||
|
|||||||
74
Assets/Scripts/TutorialScript.cs
Normal file
74
Assets/Scripts/TutorialScript.cs
Normal file
@ -0,0 +1,74 @@
|
|||||||
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
|
using System.Collections;
|
||||||
|
using DeathBook.Model;
|
||||||
|
|
||||||
|
public class TutorialScript : MonoBehaviour {
|
||||||
|
|
||||||
|
public GameObject panel;
|
||||||
|
public Text tutorialText;
|
||||||
|
public Button btnNext;
|
||||||
|
private Level lvl;
|
||||||
|
|
||||||
|
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
lvl = LevelManager.Instance.GameLevel;
|
||||||
|
}
|
||||||
|
|
||||||
|
void Update() {
|
||||||
|
|
||||||
|
|
||||||
|
btnNext.enabled = lvl.allowNext;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (lvl.tutorialInt == 0)
|
||||||
|
{
|
||||||
|
Time.timeScale = 0;
|
||||||
|
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)
|
||||||
|
{
|
||||||
|
tutorialText.text = "See how navigating works by holding the right mouse button and moving the sphere.\n\nThen, hit Next!";
|
||||||
|
}
|
||||||
|
else if (lvl.tutorialInt == 2)
|
||||||
|
{
|
||||||
|
tutorialText.text = "Move around by left clicking on the users in the network!";
|
||||||
|
}
|
||||||
|
else if (lvl.tutorialInt == 3)
|
||||||
|
{
|
||||||
|
tutorialText.text = "Let's see what happens when you click on a user's friend list.";
|
||||||
|
}
|
||||||
|
else if (lvl.tutorialInt == 4)
|
||||||
|
{
|
||||||
|
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
|
||||||
|
{
|
||||||
|
panel.SetActive(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void btnClick()
|
||||||
|
{
|
||||||
|
|
||||||
|
lvl.tutorialInt++;
|
||||||
|
//Debug.Log(lvl.tutorialInt + ", aasfasf");
|
||||||
|
Time.timeScale = 1;
|
||||||
|
tutorialText.text = "eee";
|
||||||
|
lvl.allowNext = false;
|
||||||
|
//panel.transform.Translate(Vector3.right * 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
12
Assets/Scripts/TutorialScript.cs.meta
Normal file
12
Assets/Scripts/TutorialScript.cs.meta
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: c42f0ece4454ca044b3152cc78312428
|
||||||
|
timeCreated: 1439753311
|
||||||
|
licenseType: Free
|
||||||
|
MonoImporter:
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
@ -7,6 +7,7 @@ using UnityEngine.UI;
|
|||||||
public class UIFriendPicture : MonoBehaviour
|
public class UIFriendPicture : MonoBehaviour
|
||||||
{
|
{
|
||||||
private Person _model;
|
private Person _model;
|
||||||
|
private Level lvl;
|
||||||
|
|
||||||
public Person Model
|
public Person Model
|
||||||
{
|
{
|
||||||
@ -23,11 +24,14 @@ public class UIFriendPicture : MonoBehaviour
|
|||||||
|
|
||||||
void Awake()
|
void Awake()
|
||||||
{
|
{
|
||||||
|
lvl = LevelManager.Instance.GameLevel;
|
||||||
_picture = GetComponent<Image>();
|
_picture = GetComponent<Image>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnClick()
|
public void OnClick()
|
||||||
{
|
{
|
||||||
|
if (lvl.tutorialInt == 3)
|
||||||
|
lvl.allowNext = true;
|
||||||
_model.SelectNode();
|
_model.SelectNode();
|
||||||
_model.SelectNode();
|
_model.SelectNode();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,3 +7,5 @@ EditorBuildSettings:
|
|||||||
m_Scenes:
|
m_Scenes:
|
||||||
- enabled: 1
|
- enabled: 1
|
||||||
path: Assets/Scenes/Gameplay.unity
|
path: Assets/Scenes/Gameplay.unity
|
||||||
|
- enabled: 1
|
||||||
|
path: Assets/Scenes/splash.unity
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user