mirror of
https://github.com/smyalygames/monopoly.git
synced 2025-05-18 06:14:10 +02:00
Merge branch 'master' of https://github.com/smyalygames/monopoly
This commit is contained in:
commit
56ba1e81ef
1
.idea/.idea.Monopoly/.idea/indexLayout.xml
generated
1
.idea/.idea.Monopoly/.idea/indexLayout.xml
generated
@ -3,6 +3,7 @@
|
|||||||
<component name="ContentModelUserStore">
|
<component name="ContentModelUserStore">
|
||||||
<attachedFolders />
|
<attachedFolders />
|
||||||
<explicitIncludes>
|
<explicitIncludes>
|
||||||
|
<Path>Assets</Path>
|
||||||
<Path>Library/PackageCache/com.unity.collab-proxy@1.3.9</Path>
|
<Path>Library/PackageCache/com.unity.collab-proxy@1.3.9</Path>
|
||||||
<Path>Library/PackageCache/com.unity.ext.nunit@1.0.0</Path>
|
<Path>Library/PackageCache/com.unity.ext.nunit@1.0.0</Path>
|
||||||
<Path>Library/PackageCache/com.unity.ide.rider@1.2.1</Path>
|
<Path>Library/PackageCache/com.unity.ide.rider@1.2.1</Path>
|
||||||
|
@ -5084,7 +5084,7 @@ RectTransform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children: []
|
m_Children: []
|
||||||
m_Father: {fileID: 1110544714}
|
m_Father: {fileID: 1110544714}
|
||||||
m_RootOrder: 1
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||||
@ -6424,8 +6424,8 @@ RectTransform:
|
|||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 1235795231}
|
|
||||||
- {fileID: 976489957}
|
- {fileID: 976489957}
|
||||||
|
- {fileID: 1235795231}
|
||||||
m_Father: {fileID: 929752267}
|
m_Father: {fileID: 929752267}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 0
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
@ -7015,7 +7015,7 @@ RectTransform:
|
|||||||
- {fileID: 2007862498}
|
- {fileID: 2007862498}
|
||||||
- {fileID: 1017986387}
|
- {fileID: 1017986387}
|
||||||
m_Father: {fileID: 1110544714}
|
m_Father: {fileID: 1110544714}
|
||||||
m_RootOrder: 0
|
m_RootOrder: 1
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 1}
|
m_AnchorMin: {x: 0, y: 1}
|
||||||
m_AnchorMax: {x: 1, y: 1}
|
m_AnchorMax: {x: 1, y: 1}
|
||||||
|
13
Assets/Scripts/monopoly/AI.cs
Normal file
13
Assets/Scripts/monopoly/AI.cs
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
public class AI
|
||||||
|
{
|
||||||
|
/* TODO
|
||||||
|
* Write out a way to roll a dice.
|
||||||
|
* Buy properties
|
||||||
|
* Buy houses
|
||||||
|
* Trade
|
||||||
|
* Etc...
|
||||||
|
*/
|
||||||
|
}
|
11
Assets/Scripts/monopoly/AI.cs.meta
Normal file
11
Assets/Scripts/monopoly/AI.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: b0ed40fdbd0be7e4fa7cb5d3f95617d2
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
@ -633,6 +633,7 @@ public class Board //Creating the class for the board mechanics.
|
|||||||
public class Player
|
public class Player
|
||||||
{
|
{
|
||||||
public string name; //This is the username of the player
|
public string name; //This is the username of the player
|
||||||
|
private bool isAI; //This defines if the player is an AI.
|
||||||
private int playerNumber; //This is the player number in the queue
|
private int playerNumber; //This is the player number in the queue
|
||||||
public int money; //Initializes the variable for money.
|
public int money; //Initializes the variable for money.
|
||||||
public int position; //Positions vary from 0-39 (40 squares on the board) (Go is 0)
|
public int position; //Positions vary from 0-39 (40 squares on the board) (Go is 0)
|
||||||
@ -643,9 +644,10 @@ public class Player
|
|||||||
private Movement movement;
|
private Movement movement;
|
||||||
private TextHandler textHandler;
|
private TextHandler textHandler;
|
||||||
|
|
||||||
public Player(string playerName, int playerNumber, GameObject player)
|
public Player(string playerName, bool isAI, int playerNumber, GameObject player)
|
||||||
{
|
{
|
||||||
name = playerName; //This initialises the username of the player
|
name = playerName; //This initialises the username of the player
|
||||||
|
this.isAI = isAI;
|
||||||
position = 0; //This sets to the default position - GO
|
position = 0; //This sets to the default position - GO
|
||||||
inJail = false; //This initialises that the player isn't in jail
|
inJail = false; //This initialises that the player isn't in jail
|
||||||
this.playerNumber = playerNumber; //This is the position in the queue that the player is in
|
this.playerNumber = playerNumber; //This is the position in the queue that the player is in
|
||||||
@ -875,7 +877,7 @@ public class Main : MonoBehaviour
|
|||||||
//Names the game object player and a unique number
|
//Names the game object player and a unique number
|
||||||
Instantiate(playerTemplate, playerTemplate.transform.position, Quaternion.identity, playerParentGameObject.transform).name = $"Player{i}";
|
Instantiate(playerTemplate, playerTemplate.transform.position, Quaternion.identity, playerParentGameObject.transform).name = $"Player{i}";
|
||||||
playersGameObjects.Add(GameObject.Find($"/Players/Player{i}")); //Adds to a list of GameObjects by searching for the GameObject.
|
playersGameObjects.Add(GameObject.Find($"/Players/Player{i}")); //Adds to a list of GameObjects by searching for the GameObject.
|
||||||
players.Add(new Player($"Player {i}", i, playersGameObjects[i])); //Creates a unique player class for that specific GameObject
|
players.Add(new Player($"Player {i}", false, i, playersGameObjects[i])); //Creates a unique player class for that specific GameObject
|
||||||
}
|
}
|
||||||
|
|
||||||
Destroy(playerTemplate); //Deletes the player template GameObject.
|
Destroy(playerTemplate); //Deletes the player template GameObject.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user