Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Converted to 2d
  • Loading branch information
smz11006 committed Dec 3, 2015
1 parent f1d36b9 commit 24817a2
Show file tree
Hide file tree
Showing 156 changed files with 1,265 additions and 38 deletions.
9 changes: 9 additions & 0 deletions Roguelike/Assets/Materials/Floors.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Roguelike/Assets/Materials/Floors/FloorBlue.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Materials/Floors/FloorBlue.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Roguelike/Assets/Materials/Floors/FloorExit.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Materials/Floors/FloorExit.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Roguelike/Assets/Materials/Floors/FloorGreen.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Materials/Floors/FloorGreen.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Roguelike/Assets/Materials/Floors/FloorRed.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Materials/Floors/FloorRed.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added Roguelike/Assets/Materials/Floors/FloorYellow.mat
Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Materials/Floors/FloorYellow.mat.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Roguelike/Assets/Prefabs/Environment.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Prefabs/Environment/Floor1.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Prefabs/Environment/Floor2.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Prefabs/Environment/Floor3.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Prefabs/Environment/Floor4.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike/Assets/Prefabs/Environment/FloorExit.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Roguelike/Assets/Scenes/ProceduralGenerationTest.unity
Binary file not shown.
31 changes: 26 additions & 5 deletions Roguelike/Assets/Scripts/ProdGen/BoardManager.cs
Expand Up @@ -3,8 +3,8 @@ using System;
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
{
//namespace Completed
//{

public class BoardManager : MonoBehaviour {
//Using serializable allows us to embed a class wit hsub properties in sinpsector
Expand Down Expand Up @@ -90,42 +90,63 @@ public class BoardManager : MonoBehaviour {
//RanndomPosition returns a random position from our gridpositions
Vector3 RandomPosition()
{
//Declare an integer randomInxdex, set its value to a ranom umber btween 0 and the count of items
int randomIndex = Random.Range(0, gridPositions.Count);

//Declare a variable of type Vector3 called Randomp position, set its value to the etnry ant RandomIndex
Vector3 randomPosition = gridPositions[randomIndex];

//Remove the etnry at randomIndex from the list so that it can't be re-used
gridPositions.RemoveAt(randomIndex);

//return the randomly selected Vector3 position
return randomPosition;
}

//
//LaoyutObjectAtRandom acepts an array of game obejcts to choose from along with a minimu and maximum
void LayoutObjectAtRandom(GameObject[] tileArray, int minimum, int maximum)
{
//Choose a random number of objects to instanciate within the minimum and maximum limits
int objectCount = Random.Range(minimum, maximum + 1);
//Instanciate objects until the randomly chosen limit objectcount is reached
for(int i = 0; i< objectCount; i++)
{

//Choose a random number of objects to isnanciate wtihin the minimum and maximum limits
Vector3 randomPosition = RandomPosition();

//Choose a random tile from tile Array and assign it to tileChoice
GameObject tileChoice = tileArray[Random.Range(0, tileArray.Length)];

//Insanciate tileCHoice at the position returned by RandomPositon with no change in rotation
Instantiate(tileChoice, randomPosition, Quaternion.identity);
}
}


//SetupScene initializeds our level and calls the previous functions to lay out the game board
public void SetupScene(int level)
{
//creates the outer walls and floor
BoardSetup();

//resets our list of gridposionts
InitialiseList();

//Instanciate a random number of walll tiles based on min/max, at random positions
LayoutObjectAtRandom(wallTiles, wallCount.minimum, wallCount.maximum);

//Instanciate a random number of food tiles based on min/max, at random positions
LayoutObjectAtRandom(foodTiles, foodCount.minimum, foodCount.maximum);

//Determine number of enemies based on current level number, based on logarithim progression
int enemyCount = (int)Mathf.Log(level, 2f);

//Instanciate arndom number of enmies based on min/max, at random positions
LayoutObjectAtRandom(enemyTiles, enemyCount, enemyCount);

//Instanciate the xtilre til in the upper right hand corner of our game board
Instantiate(exit, new Vector3(columns - 1, rows - 1, 0f), Quaternion.identity);
}

}
}
//}
25 changes: 25 additions & 0 deletions Roguelike/Assets/Scripts/ProdGen/GameManager.cs
@@ -0,0 +1,25 @@
using UnityEngine;
using System.Collections;

public class GameManager : MonoBehaviour {

public BoardManager boardScript;

private int level = 3;
// Use this for initialization
void Awake ()
{
boardScript = GetComponent<BoardManager>();

}

void InitGame()
{
boardScript.SetupScene(level);
}

// Update is called once per frame
void Update () {

}
}
12 changes: 12 additions & 0 deletions Roguelike/Assets/Scripts/ProdGen/GameManager.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file modified Roguelike/Library/CurrentLayout.dwlt
Binary file not shown.
Binary file modified Roguelike/Library/InspectorExpandedItems.asset
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
Binary file not shown.
Binary file modified Roguelike/Library/assetDatabase3
Binary file not shown.
Binary file modified Roguelike/Library/expandedItems
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000002000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000003000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000004000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000004100000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000005000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000005100000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000006000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000006100000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000007000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000008000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000008100000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000009000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/00000000000000009100000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/0000000000000000a000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/0000000000000000b000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/00/0000000000000000c000000000000000
Binary file not shown.
Binary file modified Roguelike/Library/metadata/04/0401554a0e6f9466db3c1a798d358b8c
Binary file not shown.
Binary file modified Roguelike/Library/metadata/08/085d9842593af44d8a507541ce47bc6e
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/Library/metadata/17/17799b66b509c40a78360036fcfbc8bc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/Library/metadata/3d/3d2e08407829a435b84ff5ac7f8b3aef
Binary file not shown.
Binary file modified Roguelike/Library/metadata/46/469ffe30a4f3a43d99d202b74660b1e5
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/Library/metadata/6b/6bf45a0ab38a1458999f7d05487b4d52
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/Library/metadata/76/766f29702ce4e4a1584e5147c88629a2
Binary file not shown.
Binary file modified Roguelike/Library/metadata/8a/8a32d65a6a0c443f79048586c9648b05
Binary file not shown.
Binary file modified Roguelike/Library/metadata/95/95eeb1bd7377a64459d7663226831e8d.info
Binary file not shown.
Binary file modified Roguelike/Library/metadata/9b/9b368950d11817b40913157cadb3c1b0.info
Binary file not shown.
Binary file modified Roguelike/Library/metadata/a0/a0fbd16cf167148268ecb856d017aee7
Binary file not shown.
Binary file modified Roguelike/Library/metadata/bb/bb289d62091f1ed4f85a8cf05a0608ac.info
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/Library/metadata/cf/cf4d693f4d204ec448f2bcd7640acba1.info
Binary file not shown.
Binary file modified Roguelike/Library/metadata/d1/d10aa5ca016ed594dbaf0d44a8063a91
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/Library/metadata/d2/d2ef3b15c32eb43108261a87963b8937
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified Roguelike/ProjectSettings/TagManager.asset
Binary file not shown.
2 changes: 2 additions & 0 deletions Roguelike/Roguelike.CSharp.csproj
Expand Up @@ -71,6 +71,8 @@
<Compile Include="Assets\Scripts\EnemySkeleton.cs" />
<Compile Include="Assets\Scripts\EnemyZombie.cs" />
<Compile Include="Assets\Scripts\Player.cs" />
<Compile Include="Assets\Scripts\ProdGen\BoardManager.cs" />
<Compile Include="Assets\Scripts\ProdGen\GameManager.cs" />
<Compile Include="Assets\iTweenEditor\Examples\StartAndStopTween.cs" />
<Compile Include="Assets\iTweenEditor\Helper Classes\EventParamMappings.cs" />
<Compile Include="Assets\iTweenEditor\Helper Classes\Vector3OrTransform.cs" />
Expand Down
46 changes: 13 additions & 33 deletions Roguelike/Roguelike.sln
@@ -1,46 +1,26 @@
Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2008

Project("{6F0D6A32-94BE-20CA-6EE5-FBB0F0AAAF5C}") = "Roguelike", "Assembly-CSharp.csproj", "{3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}"

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2015
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Roguelike.CSharp", "Roguelike.CSharp.csproj", "{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}"
EndProject
Project("{6F0D6A32-94BE-20CA-6EE5-FBB0F0AAAF5C}") = "Roguelike", "Assembly-CSharp-Editor.csproj", "{E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Roguelike.CSharp.Editor", "Roguelike.CSharp.Editor.csproj", "{CAED324B-6229-B97C-3095-98CF546CD4B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3B4D7A7B-B193-C7B8-731F-3F701A73DF6D}.Release|Any CPU.Build.0 = Release|Any CPU
{E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E74DF5C1-0ADD-8EF0-B7F4-4805EC25D62D}.Release|Any CPU.Build.0 = Release|Any CPU
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3DFE4C14-E1E8-D3F3-25DE-8BBE8DEFCFD5}.Release|Any CPU.Build.0 = Release|Any CPU
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CAED324B-6229-B97C-3095-98CF546CD4B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
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
9 changes: 9 additions & 0 deletions Roguelike2d/Assets/Prefabs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Enemy1.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Enemy2.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Exit.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Floor1.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Floor2.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Floor3.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Floor4.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/Food.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.
8 changes: 8 additions & 0 deletions Roguelike2d/Assets/Prefabs/Environment/OuterWall1.prefab.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file not shown.

0 comments on commit 24817a2

Please sign in to comment.