Skip to content
Permalink
Browse files

Player movement in Roguelike

  • Loading branch information
smz11006 committed Nov 17, 2015
1 parent d29b0b9 commit e196abb75fe8427a666c0248ca58689f405532d3
Showing with 41,913 additions and 13 deletions.
  1. BIN Roguelike/Assets/Scenes/EnemyAITest.unity
  2. +16 −3 Roguelike/Assets/Scripts/EnemyZombie.cs
  3. +36 −7 Roguelike/Assets/Scripts/Player.cs
  4. +9 −0 Roguelike/Assets/iTweenEditor.meta
  5. +9 −0 Roguelike/Assets/iTweenEditor/Editor.meta
  6. +352 −0 Roguelike/Assets/iTweenEditor/Editor/iTweenEventDataEditor.cs
  7. +10 −0 Roguelike/Assets/iTweenEditor/Editor/iTweenEventDataEditor.cs.meta
  8. +97 −0 Roguelike/Assets/iTweenEditor/Editor/iTweenPathEditor.cs
  9. +10 −0 Roguelike/Assets/iTweenEditor/Editor/iTweenPathEditor.cs.meta
  10. +9 −0 Roguelike/Assets/iTweenEditor/Examples.meta
  11. BIN Roguelike/Assets/iTweenEditor/Examples/Path Test.unity
  12. +6 −0 Roguelike/Assets/iTweenEditor/Examples/Path Test.unity.meta
  13. BIN Roguelike/Assets/iTweenEditor/Examples/StartAndStopATween.unity
  14. +6 −0 Roguelike/Assets/iTweenEditor/Examples/StartAndStopATween.unity.meta
  15. +27 −0 Roguelike/Assets/iTweenEditor/Examples/StartAndStopTween.cs
  16. +10 −0 Roguelike/Assets/iTweenEditor/Examples/StartAndStopTween.cs.meta
  17. +9 −0 Roguelike/Assets/iTweenEditor/Gizmos.meta
  18. BIN Roguelike/Assets/iTweenEditor/Gizmos/iTweenIcon.tif
  19. +54 −0 Roguelike/Assets/iTweenEditor/Gizmos/iTweenIcon.tif.meta
  20. +9 −0 Roguelike/Assets/iTweenEditor/Helper Classes.meta
  21. +742 −0 Roguelike/Assets/iTweenEditor/Helper Classes/EventParamMappings.cs
  22. +10 −0 Roguelike/Assets/iTweenEditor/Helper Classes/EventParamMappings.cs.meta
  23. +31 −0 Roguelike/Assets/iTweenEditor/Helper Classes/Vector3OrTransform.cs
  24. +10 −0 Roguelike/Assets/iTweenEditor/Helper Classes/Vector3OrTransform.cs.meta
  25. +34 −0 Roguelike/Assets/iTweenEditor/Helper Classes/Vector3OrTransformArray.cs
  26. +10 −0 Roguelike/Assets/iTweenEditor/Helper Classes/Vector3OrTransformArray.cs.meta
  27. +47 −0 Roguelike/Assets/iTweenEditor/README.txt
  28. +6 −0 Roguelike/Assets/iTweenEditor/README.txt.meta
  29. +7,489 −0 Roguelike/Assets/iTweenEditor/iTween.cs
  30. +10 −0 Roguelike/Assets/iTweenEditor/iTween.cs.meta
  31. +560 −0 Roguelike/Assets/iTweenEditor/iTweenEvent.cs
  32. +10 −0 Roguelike/Assets/iTweenEditor/iTweenEvent.cs.meta
  33. +38 −0 Roguelike/Assets/iTweenEditor/iTweenPath.cs
  34. +10 −0 Roguelike/Assets/iTweenEditor/iTweenPath.cs.meta
  35. BIN Roguelike/Library/AssetServerCacheV3
  36. BIN Roguelike/Library/AssetVersioning.db
  37. BIN Roguelike/Library/CurrentLayout.dwlt
  38. BIN Roguelike/Library/InspectorExpandedItems.asset
  39. BIN Roguelike/Library/ProjectSettings.asset
  40. BIN Roguelike/Library/ScriptAssemblies/Assembly-CSharp-Editor.dll.mdb
  41. BIN Roguelike/Library/ScriptAssemblies/Assembly-CSharp.dll.mdb
  42. +2 −2 Roguelike/Library/ScriptAssemblies/BuiltinAssemblies.stamp
  43. BIN Roguelike/Library/ScriptMapper
  44. BIN Roguelike/Library/ShaderCache/0/06776728e33fc9af2ed1df4f3d08faa1.bin
  45. BIN Roguelike/Library/ShaderCache/0/097886457247838aa7d8d2a0b2111588.bin
  46. BIN Roguelike/Library/ShaderCache/3/3a8eef78a3b767f892b1d97fcf953a0b.bin
  47. BIN Roguelike/Library/ShaderCache/3/3c5f7dab95c09023d4c67b736c849ea0.bin
  48. BIN Roguelike/Library/ShaderCache/7/7874cccdc2bf25a8e9d878ea75d9430f.bin
  49. BIN Roguelike/Library/ShaderCache/7/7dd1923df1950e9b523bee33d162ee3a.bin
  50. BIN Roguelike/Library/ShaderCache/7/7eccc90b4e57ec4e03c6da60f7797ebe.bin
  51. BIN Roguelike/Library/ShaderCache/8/8e25c819e481ea97d2a82166887ba567.bin
  52. BIN Roguelike/Library/ShaderCache/9/9411315f81fe093333e359470f322bdb.bin
  53. BIN Roguelike/Library/ShaderCache/e/e872f533f2a0ded4f1f3c8df3929e2b1.bin
  54. +8 −0 Roguelike/Library/UnityAssemblies/UnityEditor.Advertisements.xml
  55. +8 −0 Roguelike/Library/UnityAssemblies/UnityEditor.Networking.xml
  56. +363 −0 Roguelike/Library/UnityAssemblies/UnityEditor.UI.xml
  57. +21,588 −0 Roguelike/Library/UnityAssemblies/UnityEditor.xml
  58. +3,926 −0 Roguelike/Library/UnityAssemblies/UnityEngine.Networking.xml
  59. +5,843 −0 Roguelike/Library/UnityAssemblies/UnityEngine.UI.xml
  60. +23 −0 Roguelike/Library/UnityAssemblies/version.txt
  61. BIN Roguelike/Library/assetDatabase3
  62. BIN Roguelike/Library/expandedItems
  63. BIN Roguelike/Library/metadata/00/00000000000000002000000000000000
  64. BIN Roguelike/Library/metadata/00/00000000000000003000000000000000
  65. BIN Roguelike/Library/metadata/00/00000000000000004000000000000000
  66. BIN Roguelike/Library/metadata/00/00000000000000004100000000000000
  67. BIN Roguelike/Library/metadata/00/00000000000000005000000000000000
  68. BIN Roguelike/Library/metadata/00/00000000000000005100000000000000
  69. BIN Roguelike/Library/metadata/00/00000000000000006000000000000000
  70. BIN Roguelike/Library/metadata/00/00000000000000006100000000000000
  71. BIN Roguelike/Library/metadata/00/00000000000000007000000000000000
  72. BIN Roguelike/Library/metadata/00/00000000000000008000000000000000
  73. BIN Roguelike/Library/metadata/00/00000000000000008100000000000000
  74. BIN Roguelike/Library/metadata/00/00000000000000008100000000000000.info
  75. BIN Roguelike/Library/metadata/00/00000000000000009000000000000000
  76. BIN Roguelike/Library/metadata/00/00000000000000009100000000000000
  77. BIN Roguelike/Library/metadata/00/00000000000000009100000000000000.info
  78. BIN Roguelike/Library/metadata/00/0000000000000000a000000000000000
  79. BIN Roguelike/Library/metadata/00/0000000000000000b000000000000000
  80. BIN Roguelike/Library/metadata/00/0000000000000000c000000000000000
  81. BIN Roguelike/Library/metadata/04/0401554a0e6f9466db3c1a798d358b8c
  82. BIN Roguelike/Library/metadata/04/0401554a0e6f9466db3c1a798d358b8c.info
  83. BIN Roguelike/Library/metadata/08/085d9842593af44d8a507541ce47bc6e
  84. BIN Roguelike/Library/metadata/08/085d9842593af44d8a507541ce47bc6e.info
  85. BIN Roguelike/Library/metadata/17/17799b66b509c40a78360036fcfbc8bc
  86. BIN Roguelike/Library/metadata/17/17799b66b509c40a78360036fcfbc8bc.info
  87. BIN Roguelike/Library/metadata/23/2346d67c96ebcaa45a41206a80cb0345
  88. BIN Roguelike/Library/metadata/2c/2cd963efa0be1416c93438361364da95
  89. BIN Roguelike/Library/metadata/2c/2cd963efa0be1416c93438361364da95.info
  90. BIN Roguelike/Library/metadata/31/31db21470894e5441a37a2958e10dd6a
  91. BIN Roguelike/Library/metadata/3d/3d2e08407829a435b84ff5ac7f8b3aef
  92. BIN Roguelike/Library/metadata/3d/3d2e08407829a435b84ff5ac7f8b3aef.info
  93. BIN Roguelike/Library/metadata/46/469ffe30a4f3a43d99d202b74660b1e5
  94. BIN Roguelike/Library/metadata/46/469ffe30a4f3a43d99d202b74660b1e5.info
  95. BIN Roguelike/Library/metadata/5f/5f32cd94baa94578a686d4b9d6b660f7
  96. BIN Roguelike/Library/metadata/5f/5f32cd94baa94578a686d4b9d6b660f7.info
  97. BIN Roguelike/Library/metadata/64/64ae91fffe7b7f9418d6196343d49eff
  98. BIN Roguelike/Library/metadata/6a/6a8c0b05903578e4aa1289285ffee5cb
  99. BIN Roguelike/Library/metadata/6b/6bf45a0ab38a1458999f7d05487b4d52
  100. BIN Roguelike/Library/metadata/6b/6bf45a0ab38a1458999f7d05487b4d52.info
  101. BIN Roguelike/Library/metadata/73/739bbd9f364b4268874f9fd86ab3beef
  102. BIN Roguelike/Library/metadata/73/739bbd9f364b4268874f9fd86ab3beef.info
  103. BIN Roguelike/Library/metadata/76/766f29702ce4e4a1584e5147c88629a2
  104. BIN Roguelike/Library/metadata/76/766f29702ce4e4a1584e5147c88629a2.info
  105. BIN Roguelike/Library/metadata/79/797ae283e17aa4827a330e531ef47b73
  106. BIN Roguelike/Library/metadata/79/797ae283e17aa4827a330e531ef47b73.info
  107. BIN Roguelike/Library/metadata/7f/7f294180677264249b663e086b83af75
  108. BIN Roguelike/Library/metadata/7f/7f294180677264249b663e086b83af75.info
  109. BIN Roguelike/Library/metadata/80/80a3616ca19596e4da0f10f14d241e9f
  110. BIN Roguelike/Library/metadata/80/80a3616ca19596e4da0f10f14d241e9f.info
  111. BIN Roguelike/Library/metadata/85/852e56802eb941638acbb491814497b0
  112. BIN Roguelike/Library/metadata/85/852e56802eb941638acbb491814497b0.info
  113. BIN Roguelike/Library/metadata/86/861b2dd019953d64f84df72a7b2f8372
  114. BIN Roguelike/Library/metadata/86/861b2dd019953d64f84df72a7b2f8372.info
  115. BIN Roguelike/Library/metadata/87/870353891bb340e2b2a9c8707e7419ba
  116. BIN Roguelike/Library/metadata/87/870353891bb340e2b2a9c8707e7419ba.info
  117. BIN Roguelike/Library/metadata/8a/8a32d65a6a0c443f79048586c9648b05
  118. BIN Roguelike/Library/metadata/8a/8a32d65a6a0c443f79048586c9648b05.info
  119. BIN Roguelike/Library/metadata/94/94e8cb70729c77148a01af6a35e0e144
  120. BIN Roguelike/Library/metadata/94/94e8cb70729c77148a01af6a35e0e144.info
  121. BIN Roguelike/Library/metadata/95/95eeb1bd7377a64459d7663226831e8d
  122. BIN Roguelike/Library/metadata/95/95eeb1bd7377a64459d7663226831e8d.info
  123. BIN Roguelike/Library/metadata/97/97decbdab0634cdd991f8d23ddf0dead
  124. BIN Roguelike/Library/metadata/97/97decbdab0634cdd991f8d23ddf0dead.info
  125. BIN Roguelike/Library/metadata/98/98601a450fc9cbd418cb1091c9027907
  126. BIN Roguelike/Library/metadata/99/99aae065ca13f46398c1f65ebc52f413
  127. BIN Roguelike/Library/metadata/99/99aae065ca13f46398c1f65ebc52f413.info
  128. BIN Roguelike/Library/metadata/9a/9a0e6727026ec924da7a25f275a934b5
  129. BIN Roguelike/Library/metadata/9a/9a0e6727026ec924da7a25f275a934b5.info
  130. BIN Roguelike/Library/metadata/9b/9b368950d11817b40913157cadb3c1b0
  131. BIN Roguelike/Library/metadata/9b/9b368950d11817b40913157cadb3c1b0.info
  132. BIN Roguelike/Library/metadata/a0/a0fbd16cf167148268ecb856d017aee7
  133. BIN Roguelike/Library/metadata/a0/a0fbd16cf167148268ecb856d017aee7.info
  134. BIN Roguelike/Library/metadata/a5/a5132e76f39f32d4caea99ef7c83d636
  135. BIN Roguelike/Library/metadata/a5/a5132e76f39f32d4caea99ef7c83d636.info
  136. BIN Roguelike/Library/metadata/a8/a8e673567ac33e04487feec5673c2cc2
  137. BIN Roguelike/Library/metadata/b2/b29345d5dd22ad745af7283665fa4dc4
  138. BIN Roguelike/Library/metadata/b8/b8485d431406560409afdc9572299190
  139. BIN Roguelike/Library/metadata/bb/bb289d62091f1ed4f85a8cf05a0608ac
  140. BIN Roguelike/Library/metadata/bb/bb289d62091f1ed4f85a8cf05a0608ac.info
  141. BIN Roguelike/Library/metadata/bb/bb43dfaa5df3fd7499cb08815296d42f
  142. BIN Roguelike/Library/metadata/bb/bb43dfaa5df3fd7499cb08815296d42f.info
  143. BIN Roguelike/Library/metadata/bb/bb716fad3585fad448da9b20cee7b0fa
  144. BIN Roguelike/Library/metadata/bb/bb716fad3585fad448da9b20cee7b0fa.info
  145. BIN Roguelike/Library/metadata/be/be10fc2a1b44c42ab8d6af8637b7bb96
  146. BIN Roguelike/Library/metadata/be/be10fc2a1b44c42ab8d6af8637b7bb96.info
  147. BIN Roguelike/Library/metadata/ca/ca3447eb3a828184ab4ba5f5996b14c7
  148. BIN Roguelike/Library/metadata/cf/cf4d693f4d204ec448f2bcd7640acba1
  149. BIN Roguelike/Library/metadata/cf/cf4d693f4d204ec448f2bcd7640acba1.info
  150. BIN Roguelike/Library/metadata/d2/d2ef3b15c32eb43108261a87963b8937
  151. BIN Roguelike/Library/metadata/d2/d2ef3b15c32eb43108261a87963b8937.info
  152. BIN Roguelike/Library/metadata/da/dae752d8f72c9504082676f59a9ce704
  153. BIN Roguelike/Library/metadata/da/dae752d8f72c9504082676f59a9ce704.info
  154. BIN Roguelike/Library/metadata/e8/e824886ca6f7c40a4a622b6a82c50c9c
  155. BIN Roguelike/Library/metadata/e8/e824886ca6f7c40a4a622b6a82c50c9c.info
  156. BIN Roguelike/Library/metadata/ec/ec28203e77d39e74fbe69292ba584d64
  157. BIN Roguelike/Library/metadata/ec/ec28203e77d39e74fbe69292ba584d64.info
  158. BIN Roguelike/Library/metadata/ef/efe8af026bd06914d9826fc55d722275
  159. BIN Roguelike/Library/metadata/f3/f3bb37550d4444b87ad7543d746b1c95
  160. BIN Roguelike/Library/metadata/f3/f3bb37550d4444b87ad7543d746b1c95.info
  161. BIN Roguelike/Library/metadata/f5/f5f67c52d1564df4a8936ccd202a3bd8
  162. BIN Roguelike/Library/metadata/f5/f5f67c52d1564df4a8936ccd202a3bd8.info
  163. BIN Roguelike/Library/metadata/fe/fee89e7023b014869aee949adecdc426
  164. BIN Roguelike/Library/metadata/fe/fee89e7023b014869aee949adecdc426.info
  165. BIN Roguelike/ProjectSettings/ProjectSettings.asset
  166. +1 −1 Roguelike/ProjectSettings/ProjectVersion.txt
  167. BIN Roguelike/ProjectSettings/TagManager.asset
  168. BIN Roguelike/ProjectSettings/UnityAdsSettings.asset
  169. BIN Roguelike/ProjectSettings/UnityAnalyticsManager.asset
  170. +144 −0 Roguelike/Roguelike.CSharp.Editor.csproj
  171. +94 −0 Roguelike/Roguelike.CSharp.csproj
  172. +26 −0 Roguelike/Roguelike.sln
  173. +22 −0 gitignore/.gitignore
  174. +15 −0 z_Misc_Docs/UI/JazzZombieTagScript.cs
  175. +12 −0 z_Misc_Docs/UI/JazzZombieTagScript.cs.meta
  176. +23 −0 z_Misc_Docs/UI/MainMenu.cs
  177. +12 −0 z_Misc_Docs/UI/MainMenu.cs.meta
  178. +15 −0 z_Misc_Docs/UI/MetalZombieTagScript.cs
  179. +12 −0 z_Misc_Docs/UI/MetalZombieTagScript.cs.meta
  180. +77 −0 z_Misc_Docs/UI/UI_Tooltip.cs
  181. +14 −0 z_Misc_Docs/UI/UI_Tooltip.cs.meta
  182. +9 −0 z_Misc_Docs/UI/ZombieNotificationScripts.meta
Binary file not shown.
@@ -2,14 +2,27 @@
using System.Collections;

public class EnemyZombie : MonoBehaviour {

public Ray ray;
public GameObject player;
// Use this for initialization
void Start () {
void Start ()
{

}

// Update is called once per frame
void Update () {
void Update ()
{
RaycastHit hit;
ray = new Ray(transform.position, Vector3.down);

if (Physics.Raycast(ray, out hit))
{
if(hit.collider.tag == "player")
{
transform.position = player.transform.position;
}
}

}
}
@@ -3,13 +3,42 @@

public class Player : MonoBehaviour {

// Use this for initialization
void Start () {

}

//Declaration
public GameObject player;

public float xPos;

public float zPos;
public Vector3 playerPos;
public float distance;

public Ray ray;
public RaycastHit hit;
public Vector3 travel;

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

void Update ()
{
xPos = Input.mousePosition.x;
zPos = Input.mousePosition.z;

ray = Camera.main.ScreenPointToRay(Input.mousePosition);

if (Input.GetMouseButtonDown(1))
{
if (Physics.Raycast(ray, out hit))
{
travel = new Vector3(hit.point.x, .5f, hit.point.z);
xPos = hit.point.x;
zPos = hit.point.z;
}
playerPos = new Vector3(xPos, 0.5f, zPos);
iTween.MoveTo(gameObject, playerPos, distance);
distance = Vector3.Distance(travel, transform.position);

}
playerPos = new Vector3(xPos, 0.5f, zPos);

// player.transform.position = playerPos;
}
}

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

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

0 comments on commit e196abb

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