Skip to content
Permalink
Browse files

Players can move!

  • Loading branch information
smz11006 committed Dec 15, 2015
1 parent e2336cb commit 614415cb52a499f4f8500b497b58e6dad314885c
Showing with 685 additions and 0 deletions.
  1. +9 −0 Roguelike2d/Assets/Prefabs/Enemies.meta
  2. BIN Roguelike2d/Assets/Prefabs/Enemies/Megabot_Melee.prefab
  3. +8 −0 Roguelike2d/Assets/Prefabs/Enemies/Megabot_Melee.prefab.meta
  4. BIN Roguelike2d/Assets/Prefabs/Enemies/Megabot_Ranged.prefab
  5. +8 −0 Roguelike2d/Assets/Prefabs/Enemies/Megabot_Ranged.prefab.meta
  6. BIN Roguelike2d/Assets/Prefabs/Enemies/Skull_Melee.prefab
  7. +8 −0 Roguelike2d/Assets/Prefabs/Enemies/Skull_Melee.prefab.meta
  8. BIN Roguelike2d/Assets/Prefabs/Enemies/Skull_Ranged.prefab
  9. +8 −0 Roguelike2d/Assets/Prefabs/Enemies/Skull_Ranged.prefab.meta
  10. BIN Roguelike2d/Assets/Prefabs/Environment/Battery.prefab
  11. +8 −0 Roguelike2d/Assets/Prefabs/Environment/Battery.prefab.meta
  12. BIN Roguelike2d/Assets/Prefabs/Environment/Exit.prefab
  13. BIN Roguelike2d/Assets/Prefabs/Environment/OuterWall1.prefab
  14. BIN Roguelike2d/Assets/Prefabs/Environment/OuterWall2.prefab
  15. BIN Roguelike2d/Assets/Prefabs/Environment/OuterWall3.prefab
  16. BIN Roguelike2d/Assets/Prefabs/Environment/Wall1.prefab
  17. BIN Roguelike2d/Assets/Prefabs/Environment/Wall2.prefab
  18. BIN Roguelike2d/Assets/Prefabs/Environment/Wall3.prefab
  19. +9 −0 Roguelike2d/Assets/Prefabs/Player.meta
  20. BIN Roguelike2d/Assets/Prefabs/Player/Player.prefab
  21. +8 −0 Roguelike2d/Assets/Prefabs/Player/Player.prefab.meta
  22. BIN Roguelike2d/Assets/Scenes/ProcGenTest.unity
  23. +15 −0 Roguelike2d/Assets/Script/NextLevel.cs
  24. +12 −0 Roguelike2d/Assets/Script/NextLevel.cs.meta
  25. +30 −0 Roguelike2d/Assets/Script/PlayerMovement.cs
  26. +12 −0 Roguelike2d/Assets/Script/PlayerMovement.cs.meta
  27. +4 −0 Roguelike2d/Assets/Script/ProdGen/BoardManager.cs
  28. BIN Roguelike2d/Assets/Sprites/BatteryPickup.png
  29. +56 −0 Roguelike2d/Assets/Sprites/BatteryPickup.png.meta
  30. +9 −0 Roguelike2d/Assets/Sprites/Enemy.meta
  31. BIN Roguelike2d/Assets/Sprites/Enemy/New Animation.anim
  32. +8 −0 Roguelike2d/Assets/Sprites/Enemy/New Animation.anim.meta
  33. BIN Roguelike2d/Assets/Sprites/Enemy/Robot1.png
  34. +56 −0 Roguelike2d/Assets/Sprites/Enemy/Robot1.png.meta
  35. BIN Roguelike2d/Assets/Sprites/Enemy/Robot2.png
  36. +56 −0 Roguelike2d/Assets/Sprites/Enemy/Robot2.png.meta
  37. BIN Roguelike2d/Assets/Sprites/Enemy/Skull1.controller
  38. +8 −0 Roguelike2d/Assets/Sprites/Enemy/Skull1.controller.meta
  39. BIN Roguelike2d/Assets/Sprites/Enemy/Skull1.png
  40. +56 −0 Roguelike2d/Assets/Sprites/Enemy/Skull1.png.meta
  41. BIN Roguelike2d/Assets/Sprites/Enemy/Skull2.png
  42. +56 −0 Roguelike2d/Assets/Sprites/Enemy/Skull2.png.meta
  43. +9 −0 Roguelike2d/Assets/Sprites/PlayerSprites.meta
  44. BIN Roguelike2d/Assets/Sprites/PlayerSprites/PlayerAnimations.controller
  45. +8 −0 Roguelike2d/Assets/Sprites/PlayerSprites/PlayerAnimations.controller.meta
  46. BIN Roguelike2d/Assets/Sprites/PlayerSprites/PlayerBackLeft.png
  47. +56 −0 Roguelike2d/Assets/Sprites/PlayerSprites/PlayerBackLeft.png.meta
  48. BIN Roguelike2d/Assets/Sprites/PlayerSprites/PlayerBackRight.png
  49. +56 −0 Roguelike2d/Assets/Sprites/PlayerSprites/PlayerBackRight.png.meta
  50. BIN Roguelike2d/Assets/Sprites/PlayerSprites/PlayerForwardLeft.png
  51. +56 −0 Roguelike2d/Assets/Sprites/PlayerSprites/PlayerForwardLeft.png.meta
  52. BIN Roguelike2d/Assets/Sprites/PlayerSprites/PlayerForwardRight.png
  53. +56 −0 Roguelike2d/Assets/Sprites/PlayerSprites/PlayerForwardRight.png.meta
  54. BIN Roguelike2d/Library/CurrentLayout.dwlt
  55. BIN Roguelike2d/Library/InspectorExpandedItems.asset
  56. BIN Roguelike2d/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
  57. BIN Roguelike2d/Library/assetDatabase3
  58. BIN Roguelike2d/Library/expandedItems
  59. BIN Roguelike2d/Library/metadata/00/00000000000000003000000000000000
  60. BIN Roguelike2d/Library/metadata/00/00000000000000004000000000000000
  61. BIN Roguelike2d/Library/metadata/3b/3bfe9da865f34b84983f10cac8a4aaab.info
  62. BIN Roguelike2d/Library/metadata/d1/d10aa5ca016ed594dbaf0d44a8063a91
  63. BIN Roguelike2d/ProjectSettings/TagManager.asset

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.
@@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;

public class NextLevel : MonoBehaviour {
public GameObject player;

void OnCollisionEnter(Collision col)
{
if (col.gameObject.tag == "Exit")
{
Debug.Log("HitExit");
Application.LoadLevel(0);
}
}
}

Some generated files are not rendered by default. Learn more.

@@ -0,0 +1,30 @@
using UnityEngine;
using System.Collections;

public class PlayerMovement : MonoBehaviour {

float speed = 4f;

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

if (Input.GetKey(KeyCode.D))
{
transform.Translate(Vector2.right * speed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.A))
{
transform.Translate(-Vector2.right * speed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.W))
{
transform.Translate(Vector2.up * speed * Time.deltaTime);
}
else if (Input.GetKey(KeyCode.S))
{
transform.Translate(-Vector2.up * speed * Time.deltaTime);
}
}
}

Some generated files are not rendered by default. Learn more.

@@ -34,6 +34,7 @@ public Count(int min, int max)
public GameObject[] foodTiles; //Array of food prefabs
public GameObject[] enemyTiles; //Array of enemy prefabs
public GameObject[] outerWallTiles; //Array of ourter tile prefabs
public GameObject[] batteryTiles; //Array of the Batteries for unlocking

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
@@ -139,6 +140,9 @@ public void SetupScene(int level)
//Instanciate a random number of food tiles based on min/max, at random positions
LayoutObjectAtRandom(foodTiles, foodCount.minimum, foodCount.maximum);

//instanciate a fixed number of batteries
LayoutObjectAtRandom(batteryTiles, 4, 4);

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

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

Some generated files are not rendered by default. Learn more.

Binary file not shown.

0 comments on commit 614415c

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