Skip to content
Permalink
Browse files

Class catchup

  • Loading branch information
smz11006 committed Dec 2, 2015
1 parent 7c2f95c commit d89366994f6a2663712491f97088f44993ebd3e4
Showing with 57 additions and 366 deletions.
  1. +6 −0 Roguelike/Assembly-CSharp-Editor.csproj
  2. +6 −0 Roguelike/Assembly-CSharp.csproj
  3. +42 −23 Roguelike/Assets/Scripts/ProdGen/BoardManager.cs
  4. BIN Roguelike/Library/CurrentLayout.dwlt
  5. BIN Roguelike/Library/ProjectSettings.asset
  6. BIN Roguelike/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb
  7. BIN Roguelike/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
  8. +2 −0 Roguelike/Library/ScriptAssemblies/BuiltinAssemblies.stamp
  9. BIN Roguelike/Library/assetDatabase3
  10. BIN Roguelike/Library/metadata/00/00000000000000004000000000000000
  11. BIN Roguelike/Library/metadata/d1/d10aa5ca016ed594dbaf0d44a8063a91
  12. BIN Roguelike/ProjectSettings/ProjectSettings.asset
  13. +1 −1 Roguelike/Roguelike.sln
  14. BIN Tesselate Skbox/Assets/Scenes/SkyboxTest.unity
  15. +0 −9 Tesselate Skbox/Assets/Skyboxes/PurpleNebula.meta
  16. BIN Tesselate Skbox/Assets/Skyboxes/PurpleNebula/PurpleNebula.mat
  17. +0 −6 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/PurpleNebula.mat.meta
  18. +0 −9 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures.meta
  19. BIN Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Back_MauveSpaceBox.png
  20. +0 −53 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Back_MauveSpaceBox.png.meta
  21. BIN Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Down_MauveSpaceBox.png
  22. +0 −53 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Down_MauveSpaceBox.png.meta
  23. BIN Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Front_MauveSpaceBox.png
  24. +0 −53 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Front_MauveSpaceBox.png.meta
  25. BIN Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Left_MauveSpaceBox.png
  26. +0 −53 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Left_MauveSpaceBox.png.meta
  27. BIN Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Right_MauveSpaceBox.png
  28. +0 −53 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Right_MauveSpaceBox.png.meta
  29. BIN Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Up_MauveSpaceBox.png
  30. +0 −53 Tesselate Skbox/Assets/Skyboxes/PurpleNebula/Textures/Up_MauveSpaceBox.png.meta
@@ -48,6 +48,9 @@
<Compile Include="Assets\iTweenEditor\Editor\iTweenEventDataEditor.cs" />
<Compile Include="Assets\iTweenEditor\Editor\iTweenPathEditor.cs" />
<None Include="Assets\iTweenEditor\README.txt" />
<Reference Include="UnityEngine.Advertisements">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Advertisements">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Advertisements/Editor/UnityEditor.Advertisements.dll</HintPath>
</Reference>
@@ -63,6 +66,9 @@
<Reference Include="UnityEditor.Networking">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/Editor/UnityEditor.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="UnityEditor.Graphs">
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/UnityEditor.Graphs.dll</HintPath>
</Reference>
@@ -59,12 +59,18 @@
<Compile Include="Assets\iTweenEditor\iTweenEvent.cs" />
<Compile Include="Assets\iTweenEditor\iTweenPath.cs" />
<None Include="Assets\iTweenEditor\README.txt" />
<Reference Include="UnityEngine.Advertisements">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Advertisements/UnityEngine.Advertisements.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/GUISystem/UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Networking">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/Networking/UnityEngine.Networking.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Analytics">
<HintPath>C:/Program Files/Unity/Editor/Data/UnityExtensions/Unity/UnityAnalytics/UnityEngine.Analytics.dll</HintPath>
</Reference>
<Reference Include="Mono.Cecil">
<HintPath>C:/Program Files/Unity/Editor/Data/Managed/Mono.Cecil.dll</HintPath>
</Reference>
@@ -1,75 +1,93 @@
using UnityEngine;
using System;
using System.Collections.Generic;
using Random = UnityEngine.Random;
using System.Collections.Generic; //Allows us to use lists
using Random = UnityEngine.Random; // Tells Random to use Untiy Engine Random number generator
//++Add in Comments++
namespace Completed
{

public class BoardManager : MonoBehaviour {
//Using serializable allows us to embed a class wit hsub properties in sinpsector
[Serializable]
public class Count
{
public int minimum;
public int maximum;
public int minimum; //Minimum value for our count class
public int maximum; //Maximum value for our count class

//assignment constructor
public Count(int min, int max)
{
minimum = min;
maximum = max;
}
}

//--------------------------------------------------
public int columns = 8;
public int rows = 8;
public Count wallCount = new Count(5, 9);
public Count foodCount = new Count(1, 5);
public GameObject exit;
public GameObject[] floorTiles;
public GameObject[] wallTiles;
public GameObject[] foodTiles;
public GameObject[] enemyTiles;
public GameObject[] outerWallTiles;

private Transform boardHolder;
private List<Vector3> gridPositions = new List<Vector3>();


//Declarations--------------------------------------------------
public int columns = 8; //Number of columns in our game baord
public int rows = 8; //Number of Rows in our game board
public Count wallCount = new Count(5, 9); //Lower and upper limit for our random number
public Count foodCount = new Count(1, 5); //Lowra nd uper limit for our random food count
public GameObject exit; //Prefab to spawn for exit
//Arrays
public GameObject[] floorTiles; //Array of floor prefabs
public GameObject[] wallTiles; //Array of wall prefabs
public GameObject[] foodTiles; //Array of food prefabs
public GameObject[] enemyTiles; //Array of enemy prefabs
public GameObject[] outerWallTiles; //Array of ourter tile prefabs

private Transform boardHolder; //A variable to store references to the transform of something
private List<Vector3> gridPositions = new List<Vector3>(); //A list of possible locations to place tiles

//Clears our list gridPositions and prepares it to generate a new board.
void InitialiseList()
{
//clear our list gridPositions
gridPositions.Clear();

for(int x=1; x< columns - 1; x++)
//Loot through x axis (columns)
for (int x=1; x< columns - 1; x++)
{
//Do this thing while x>columns - 1
//within each column, loop through the y axis (rows)

for (int y = 1; y < rows -1; y++)
{
//At each index add a new vector3 to our lists with the x and y coordinates of that position
gridPositions.Add(new Vector3(x, y, 0f));
}
}
}

//Sets up the outer walls and flolors of the game
void BoardSetup()
{
//instanciates baords and sets iup boardholder to its transform
boardHolder = new GameObject("Board").transform;

//loop along the x axis, starting from - 1 (to fill corner) with floor and outerwall edge tiles
for(int x = -1; x<columns + 1; x++)
{
//Loop along y axis, starting fomr -1 to place floor or outerwall tiles
for(int y = -1; y < rows + 1; y++)
{
//choose a random tile from our array for the floor tile prefabs and prepare to instanciete
GameObject toInstanciate = floorTiles[Random.Range(0, floorTiles.Length)];
//Detect Edges
//check if we current position is at board edge, if so choose a random outerwall prefab
if (x == -1 ||x == columns|| y == -1 || y == rows)
{
toInstanciate = outerWallTiles[Random.Range(0, outerWallTiles.Length)];
}

//Instanciate Gameobject instance using prefabt chosen for toInstanciate
GameObject instance = Instantiate(toInstanciate, new Vector3(x, y, 0f), Quaternion.identity) as GameObject;

//Set the paretn of our newly isntanciated object isnatne to boardHolder
instance.transform.SetParent(boardHolder);
}
}
}

//Making random positions to spawn board pieces
//RanndomPosition returns a random position from our gridpositions
Vector3 RandomPosition()
{
int randomIndex = Random.Range(0, gridPositions.Count);
@@ -81,6 +99,7 @@ Vector3 RandomPosition()
return randomPosition;
}

//
void LayoutObjectAtRandom(GameObject[] tileArray, int minimum, int maximum)
{
int objectCount = Random.Range(minimum, maximum + 1);
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,2 @@
0000.56264290.0000
0000.562642ae.0000
BIN +0 Bytes (100%) Roguelike/Library/assetDatabase3
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -23,7 +23,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
GlobalSection(MonoDevelopProperties) = preSolution
StartupItem = Assembly-CSharp.csproj
Policies = $0
$0.TextStylePolicy = $1
Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

This file was deleted.

Binary file not shown.

0 comments on commit d893669

Please sign in to comment.
You can’t perform that action at this time.