Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Rogue's Gallery
- Loading branch information
Showing
61 changed files
with
179 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,112 @@ | |||
using UnityEngine; | |||
using System; | |||
using System.Collections.Generic; | |||
using Random = UnityEngine.Random; | |||
//++Add in Comments++ | |||
namespace Completed | |||
{ | |||
|
|||
public class BoardManager : MonoBehaviour { | |||
[Serializable] | |||
public class Count | |||
{ | |||
public int minimum; | |||
public int maximum; | |||
|
|||
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>(); | |||
|
|||
|
|||
void InitialiseList() | |||
{ | |||
gridPositions.Clear(); | |||
|
|||
for(int x=1; x< columns - 1; x++) | |||
{ | |||
//Do this thing while x>columns - 1 | |||
for (int y = 1; y < rows -1; y++) | |||
{ | |||
gridPositions.Add(new Vector3(x, y, 0f)); | |||
} | |||
} | |||
} | |||
void BoardSetup() | |||
{ | |||
boardHolder = new GameObject("Board").transform; | |||
|
|||
for(int x = -1; x<columns + 1; x++) | |||
{ | |||
for(int y = -1; y < rows + 1; y++) | |||
{ | |||
GameObject toInstanciate = floorTiles[Random.Range(0, floorTiles.Length)]; | |||
//Detect Edges | |||
if (x == -1 ||x == columns|| y == -1 || y == rows) | |||
{ | |||
toInstanciate = outerWallTiles[Random.Range(0, outerWallTiles.Length)]; | |||
} | |||
|
|||
GameObject instance = Instantiate(toInstanciate, new Vector3(x, y, 0f), Quaternion.identity) as GameObject; | |||
instance.transform.SetParent(boardHolder); | |||
} | |||
} | |||
} | |||
|
|||
Vector3 RandomPosition() | |||
{ | |||
int randomIndex = Random.Range(0, gridPositions.Count); | |||
|
|||
Vector3 randomPosition = gridPositions[randomIndex]; | |||
|
|||
gridPositions.RemoveAt(randomIndex); | |||
|
|||
return randomPosition; | |||
} | |||
|
|||
void LayoutObjectAtRandom(GameObject[] tileArray, int minimum, int maximum) | |||
{ | |||
int objectCount = Random.Range(minimum, maximum + 1); | |||
for(int i = 0; i< objectCount; i++) | |||
{ | |||
Vector3 randomPosition = RandomPosition(); | |||
|
|||
GameObject tileChoice = tileArray[Random.Range(0, tileArray.Length)]; | |||
|
|||
Instantiate(tileChoice, randomPosition, Quaternion.identity); | |||
} | |||
} | |||
public void SetupScene(int level) | |||
{ | |||
BoardSetup(); | |||
InitialiseList(); | |||
|
|||
LayoutObjectAtRandom(wallTiles, wallCount.minimum, wallCount.maximum); | |||
LayoutObjectAtRandom(foodTiles, foodCount.minimum, foodCount.maximum); | |||
|
|||
int enemyCount = (int)Mathf.Log(level, 2f); | |||
|
|||
LayoutObjectAtRandom(enemyTiles, enemyCount, enemyCount); | |||
|
|||
Instantiate(exit, new Vector3(columns - 1, rows - 1, 0f), Quaternion.identity); | |||
} | |||
|
|||
} | |||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb
Binary file not shown.
Binary file modified
BIN
+817 Bytes
(100%)
Roguelike/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
Binary file not shown.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000002000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000003000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000004000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000004100000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000005000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000005100000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000006000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000006100000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000007000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000008000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000008100000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000009000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/00000000000000009100000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/0000000000000000a000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/0000000000000000b000000000000000
Binary file not shown.
Binary file modified
BIN
+0 Bytes
(100%)
Roguelike/Library/metadata/00/0000000000000000c000000000000000
Binary file not shown.
Binary file modified
BIN
+560 Bytes
(100%)
Roguelike/Library/metadata/04/0401554a0e6f9466db3c1a798d358b8c
Binary file not shown.
Binary file modified
BIN
+7.31 KB
(100%)
Roguelike/Library/metadata/08/085d9842593af44d8a507541ce47bc6e
Binary file not shown.
Binary file modified
BIN
-2.38 KB
(56%)
Roguelike/Library/metadata/09/09d12d69864e40543808578a8eddc793.info
Binary file not shown.
Binary file modified
BIN
+48 Bytes
(100%)
Roguelike/Library/metadata/17/17799b66b509c40a78360036fcfbc8bc
Binary file not shown.
Binary file modified
BIN
-7.58 KB
(30%)
Roguelike/Library/metadata/2e/2ef0b148fac66d741b106cf2aa2fcadf.info
Binary file not shown.
Binary file modified
BIN
-2.58 KB
(52%)
Roguelike/Library/metadata/38/38bc636f319183a45a6159176069362b.info
Binary file not shown.
Binary file modified
BIN
+744 Bytes
(100%)
Roguelike/Library/metadata/3d/3d2e08407829a435b84ff5ac7f8b3aef
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+618 Bytes
Roguelike/Library/metadata/43/43394066163ff084d877d2c7f94e93a9.info
Binary file not shown.
Binary file modified
BIN
+36 Bytes
(100%)
Roguelike/Library/metadata/46/469ffe30a4f3a43d99d202b74660b1e5
Binary file not shown.
Binary file modified
BIN
-2.45 KB
(54%)
Roguelike/Library/metadata/4d/4def54ce5a27ca1489420720bb071fda.info
Binary file not shown.
Binary file modified
BIN
+24 Bytes
(100%)
Roguelike/Library/metadata/6b/6bf45a0ab38a1458999f7d05487b4d52
Binary file not shown.
Binary file modified
BIN
-2.56 KB
(51%)
Roguelike/Library/metadata/73/73cd95e4de6335e449b9bc24a3007501.info
Binary file not shown.
Binary file modified
BIN
+96 Bytes
(100%)
Roguelike/Library/metadata/76/766f29702ce4e4a1584e5147c88629a2
Binary file not shown.
Binary file modified
BIN
+28 Bytes
(100%)
Roguelike/Library/metadata/8a/8a32d65a6a0c443f79048586c9648b05
Binary file not shown.
Binary file modified
BIN
-151 Bytes
(99%)
Roguelike/Library/metadata/95/95eeb1bd7377a64459d7663226831e8d.info
Binary file not shown.
Binary file modified
BIN
-214 Bytes
(98%)
Roguelike/Library/metadata/9b/9b368950d11817b40913157cadb3c1b0.info
Binary file not shown.
Binary file modified
BIN
+352 Bytes
(100%)
Roguelike/Library/metadata/a0/a0fbd16cf167148268ecb856d017aee7
Binary file not shown.
Binary file modified
BIN
-148 Bytes
(98%)
Roguelike/Library/metadata/bb/bb289d62091f1ed4f85a8cf05a0608ac.info
Binary file not shown.
Binary file modified
BIN
-6 Bytes
(100%)
Roguelike/Library/metadata/be/be10fc2a1b44c42ab8d6af8637b7bb96.info
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+579 Bytes
Roguelike/Library/metadata/c3/c3ced61d902e9194ba48a3a90d8043ee.info
Binary file not shown.
Binary file modified
BIN
-121 Bytes
(98%)
Roguelike/Library/metadata/cf/cf4d693f4d204ec448f2bcd7640acba1.info
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+620 Bytes
Roguelike/Library/metadata/d1/d10aa5ca016ed594dbaf0d44a8063a91.info
Binary file not shown.
Binary file modified
BIN
+40 Bytes
(100%)
Roguelike/Library/metadata/d2/d2ef3b15c32eb43108261a87963b8937
Binary file not shown.
Binary file modified
BIN
-2.38 KB
(55%)
Roguelike/Library/metadata/da/da86f910cd79e0e448221c4c00cce3f9.info
Binary file not shown.
Binary file modified
BIN
-95 Bytes
(99%)
Roguelike/Library/metadata/ec/ec28203e77d39e74fbe69292ba584d64.info
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,26 +1,46 @@ | |||
|
Microsoft Visual Studio Solution File, Format Version 11.00 | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | # Visual Studio 2008 | ||
# Visual Studio 2015 |
|
||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Roguelike.CSharp", "Roguelike.CSharp.csproj", "{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}" | Project("{6F0D6A32-94BE-20CA-6EE5-FBB0F0AAAF5C}") = "Roguelike", "Assembly-CSharp.csproj", "{3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}" | ||
EndProject | EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Roguelike.CSharp.Editor", "Roguelike.CSharp.Editor.csproj", "{CAED324B-6229-B97C-3095-98CF546CD4B6}" | Project("{6F0D6A32-94BE-20CA-6EE5-FBB0F0AAAF5C}") = "Roguelike", "Assembly-CSharp-Editor.csproj", "{E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}" | ||
EndProject | EndProject | ||
Global | Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | {3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Debug|Any CPU.Build.0 = Debug|Any CPU | {3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Release|Any CPU.ActiveCfg = Release|Any CPU | {3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Release|Any CPU.Build.0 = Release|Any CPU | {3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | {E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Debug|Any CPU.Build.0 = Debug|Any CPU | {E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Release|Any CPU.ActiveCfg = Release|Any CPU | {E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Release|Any CPU.Build.0 = Release|Any CPU | {E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||
EndGlobalSection | EndGlobalSection | ||
GlobalSection(MonoDevelopProperties) = preSolution | |||
StartupItem = Assembly-CSharp.csproj | |||
Policies = $0 | |||
$0.TextStylePolicy = $1 | |||
$1.inheritsSet = null | |||
$1.scope = text/x-csharp | |||
$0.CSharpFormattingPolicy = $2 | |||
$2.inheritsSet = Mono | |||
$2.inheritsScope = text/x-csharp | |||
$2.scope = text/x-csharp | |||
$0.TextStylePolicy = $3 | |||
$3.FileWidth = 120 | |||
$3.TabWidth = 4 | |||
$3.IndentWidth = 4 | |||
$3.EolMarker = Unix | |||
$3.inheritsSet = Mono | |||
$3.inheritsScope = text/plain | |||
$3.scope = text/plain | |||
EndGlobalSection | |||
|
|||
EndGlobal | EndGlobal |
1 change: 1 addition & 0 deletions
1
Roguelike/obj/Debug/Assembly-CSharp-Editor.csproj.FileListAbsolute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
C:\Users\Drazule\Documents\Intro_Scritping\Roguelike\obj\Debug\Assembly-CSharp-Editor.csprojResolveAssemblyReference.cache |
1 change: 1 addition & 0 deletions
1
Roguelike/obj/Debug/Assembly-CSharp.csproj.FileListAbsolute.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1 @@ | |||
C:\Users\Drazule\Documents\Intro_Scritping\Roguelike\obj\Debug\Assembly-CSharp.csprojResolveAssemblyReference.cache |