Skip to content

Commit

Permalink
Powar Version 2
Browse files Browse the repository at this point in the history
Powar Version 2 is now available!

Feature List:
-AI Bot Feature! (There is an AI Bot in the game so that you won't get
bored playing alone!)
-Menu Screen (The game now starts with a Menu Screen where you can start
the game, look at the amazing view, look at the tutorial or exit)
-Game Over Screen (The game now shows a game over screen when one of the
players win the game)
-Colors! (Cubes now have colors on them to look more fancy!)
-Tutorial Screen (You can now learn the skills from this screen)
-2 New Abilities! (The game now has 2 new mechanics)
-Dash (You can now dash forward to quickly hit your enemy)
-Freeze (You can now freeze for 2 seconds in the game to juke the enemy)
-Scoreboard (You can now track the score of the players)
-Ability Cooldowns (You can now track the cooldowns of the abilities by
looking at the images)
-Platform Texture (The platform now has an icy texture to look like an
ice mountain -It's still pretty far from being one though we need
Modelling Artists)

Fix List:
-AI's problems are fixed (There were so many... I won't even try listing
them)
-The problem where some dashes wouldn't register is now fixed
(FixedUpdate() is life!)
-The bug that was causing AI to crash the game is now fixed
-The missing texture problem after the freeze ability is now fixed
  • Loading branch information
steveberkhan committed May 16, 2017
1 parent 9b34fa7 commit 47b4b7e
Show file tree
Hide file tree
Showing 1,927 changed files with 65,164 additions and 54 deletions.
17 changes: 16 additions & 1 deletion Assembly-CSharp-firstpass.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_1;UNITY_5_5;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_2;UNITY_5_5;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
Expand Down Expand Up @@ -55,9 +55,24 @@
<Compile Include="Assets\Standard Assets\Environment\Water\Water\Scripts\Water.cs" />
<Compile Include="Assets\Standard Assets\Environment\Water\Water\Scripts\WaterBase.cs" />
<Compile Include="Assets\Standard Assets\Environment\Water\Water\Scripts\WaterTile.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\ActiveStateToggler.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\ApplicationManager.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\ChangeColor.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\DragMe.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\DragPanel.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\DropMe.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\PanelManager.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\ResizePanel.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\ScrollDetailTexture.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\ShowSliderValue.cs" />
<Compile Include="Assets\Standard Assets\UI\Scripts\TiltWindow.cs" />
<None Include="Assets\Standard Assets\UI\Fonts\Jupiter\LICENSE.txt" />
<None Include="Assets\Standard Assets\Environment\Water\Water4\Shaders\FXWater4Simple.shader" />
<None Include="Assets\Standard Assets\UI\Textures and Sprites\SF UI\Background\LICENSE.txt" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Standard Assets\UI\Materials\UI-Default-No-Alpha.shader" />
<None Include="Assets\Standard Assets\Environment\Water\Water\Shaders\FXWaterPro.shader" />
<None Include="Assets\Assets\Wispy Sky\ReadMe.txt" />
<None Include="Assets\Standard Assets\Environment\Water\Water4\Shaders\WaterInclude.cginc" />
<None Include="Assets\Standard Assets\Environment\Water\Water4\Shaders\FXWater4Advanced.shader" />
<Reference Include="UnityEngine.UI">
Expand Down
9 changes: 8 additions & 1 deletion Assembly-CSharp.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>Temp\bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_1;UNITY_5_5;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
<DefineConstants>DEBUG;TRACE;UNITY_5_3_OR_NEWER;UNITY_5_4_OR_NEWER;UNITY_5_5_OR_NEWER;UNITY_5_5_2;UNITY_5_5;UNITY_5;ENABLE_AUDIO;ENABLE_CACHING;ENABLE_CLOTH;ENABLE_DUCK_TYPING;ENABLE_GENERICS;ENABLE_MICROPHONE;ENABLE_MULTIPLE_DISPLAYS;ENABLE_PHYSICS;ENABLE_SPRITERENDERER_FLIPPING;ENABLE_SPRITES;ENABLE_TERRAIN;ENABLE_RAKNET;ENABLE_UNET;ENABLE_LZMA;ENABLE_UNITYEVENTS;ENABLE_WEBCAM;ENABLE_WWW;ENABLE_CLOUD_SERVICES_COLLAB;ENABLE_CLOUD_SERVICES_ADS;ENABLE_CLOUD_HUB;ENABLE_CLOUD_PROJECT_ID;ENABLE_CLOUD_SERVICES_UNET;ENABLE_CLOUD_SERVICES_BUILD;ENABLE_CLOUD_LICENSE;ENABLE_EDITOR_METRICS;ENABLE_EDITOR_METRICS_CACHING;INCLUDE_DYNAMIC_GI;INCLUDE_GI;PLATFORM_SUPPORTS_MONO;RENDER_SOFTWARE_CURSOR;INCLUDE_PUBNUB;ENABLE_PLAYMODE_TESTS_RUNNER;ENABLE_SCRIPTING_NEW_CSHARP_COMPILER;UNITY_STANDALONE_WIN;UNITY_STANDALONE;ENABLE_SUBSTANCE;ENABLE_RUNTIME_GI;ENABLE_MOVIES;ENABLE_NETWORK;ENABLE_CRUNCH_TEXTURE_COMPRESSION;ENABLE_UNITYWEBREQUEST;ENABLE_CLOUD_SERVICES;ENABLE_CLOUD_SERVICES_ANALYTICS;ENABLE_CLOUD_SERVICES_PURCHASING;ENABLE_CLOUD_SERVICES_CRASH_REPORTING;ENABLE_EVENT_QUEUE;ENABLE_CLUSTERINPUT;ENABLE_VIDEO;ENABLE_VR;ENABLE_WEBSOCKET_HOST;ENABLE_MONO;ENABLE_PROFILER;UNITY_ASSERTIONS;UNITY_EDITOR;UNITY_EDITOR_64;UNITY_EDITOR_WIN;UNITY_TEAM_LICENSE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<NoWarn>0169</NoWarn>
Expand All @@ -46,13 +46,20 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Assets\AImovement.cs" />
<Compile Include="Assets\GameManager.cs" />
<Compile Include="Assets\LoadOnClick.cs" />
<Compile Include="Assets\destroy.cs" />
<Compile Include="Assets\getbacktomenu.cs" />
<Compile Include="Assets\movement.cs" />
<Compile Include="Assets\platformmovement.cs" />
<None Include="Assets\Standard Assets\UI\Fonts\Jupiter\LICENSE.txt" />
<None Include="Assets\Standard Assets\Environment\Water\Water4\Shaders\FXWater4Simple.shader" />
<None Include="Assets\Standard Assets\UI\Textures and Sprites\SF UI\Background\LICENSE.txt" />
<None Include="Assets\Standard Assets\Environment\Water (Basic)\Shaders\FXWaterBasic.shader" />
<None Include="Assets\Standard Assets\UI\Materials\UI-Default-No-Alpha.shader" />
<None Include="Assets\Standard Assets\Environment\Water\Water\Shaders\FXWaterPro.shader" />
<None Include="Assets\Assets\Wispy Sky\ReadMe.txt" />
<None Include="Assets\Standard Assets\Environment\Water\Water4\Shaders\WaterInclude.cginc" />
<None Include="Assets\Standard Assets\Environment\Water\Water4\Shaders\FXWater4Advanced.shader" />
<Reference Include="UnityEngine.UI">
Expand Down
160 changes: 160 additions & 0 deletions Assets/AImovement.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AImovement : MonoBehaviour {

public GameObject player;
public float speed;
public Vector3 playerorigin;
public Vector3 AIorigin;
public float targetdistance;
public float distance;
public Rigidbody rb;
public float dashspeed;
public bool dash;
public bool freeze;
public Image dashpng;
public Image freezepng;
public float dashcooldowntime;
public bool dashcooldown;
public bool freezecooldown;
public float freezecooldowntime;
public bool attackstate;
public GameObject cube;
public Material Frost;
public Material red;
public Material blu;

// Use this for initialization
void Start () {
rb = GetComponent<Rigidbody> ();
speed = 0.3f;
player = GameObject.FindGameObjectWithTag ("player1");
if (player != null) {
playerorigin = player.transform.position;
}
AIorigin = transform.position;
distance = 3f;
dashspeed = 1;
attackstate = true;
dashpng.enabled = false;
dashcooldowntime = 2;
dashcooldown = true;
freezepng.enabled = false;
freezecooldowntime = 10;
freezecooldown = false;
}

void Update(){
if (player == null) {
player = GameObject.FindGameObjectWithTag ("player1");
} else {
playerorigin = player.transform.position;
AIorigin = transform.position;
targetdistance = Vector3.Distance (playerorigin, AIorigin);
}

if(AIorigin.x > 6 && freezecooldown == false || AIorigin.x < -6 && freezecooldown == false){
freeze = true;
freezecooldown = true;
freezepng.enabled = true;

};
if(AIorigin.z > 4 && freezecooldown == false || AIorigin.z < -8 && freezecooldown == false){
freeze = true;
freezecooldown = true;
freezepng.enabled = true;

};
if (freeze) {
StartCoroutine ("froze");
}
}

// Update is called once per frame
void FixedUpdate () {
if (dashcooldown == true && dashcooldowntime > 0) {
dashcooldowntime -= Time.deltaTime;
dashpng.fillAmount = (dashcooldowntime / 5f);
} else {
dashcooldowntime = 5;
dashcooldown = false;
dashpng.enabled = false;
}

if (dash) {
dashspeed = 40;
dash = false;
} else
dashspeed = 1;

if (freezecooldown == true && freezecooldowntime > 0) {
freezecooldowntime -= Time.deltaTime;
freezepng.fillAmount = (freezecooldowntime / 10f);
} else {
freezecooldowntime = 10;
freezecooldown = false;
freezepng.enabled = false;
}

if (player != null) {
if (targetdistance > distance) {
if (playerorigin.x - AIorigin.x > 0) {
rb.AddForce (speed * dashspeed, 0, 0, ForceMode.VelocityChange);
} else
rb.AddForce (dashspeed * speed * -1, 0, 0, ForceMode.VelocityChange);
if (playerorigin.z - AIorigin.z > 0) {
rb.AddForce (0, 0, speed * dashspeed, ForceMode.VelocityChange);
} else
rb.AddForce (0, 0, dashspeed * speed * -1, ForceMode.VelocityChange);
} else if (targetdistance < distance && dashcooldown == false) {
dash = true;
dashcooldown = true;
dashpng.enabled = true;

} else {
if (Random.value >= 0.2f) {
attackstate = true;
} else
attackstate = false;
if (playerorigin.x - AIorigin.x > 0 && attackstate == true) {
rb.AddForce (speed * dashspeed, 0, 0, ForceMode.VelocityChange);
} else if (playerorigin.x - AIorigin.x > 0 && attackstate == false) {
rb.AddForce (-1 * speed * dashspeed, 0, 0, ForceMode.VelocityChange);
} else if (playerorigin.x - AIorigin.x < 0 && attackstate == true)
rb.AddForce (dashspeed * speed * -1, 0, 0, ForceMode.VelocityChange);
else if (playerorigin.x - AIorigin.x < 0 && attackstate == false) {
rb.AddForce (dashspeed * speed, 0, 0, ForceMode.VelocityChange);
}
if (playerorigin.z - AIorigin.z > 0 && attackstate == true) {
rb.AddForce (0, 0, speed * dashspeed, ForceMode.VelocityChange);
} else if (playerorigin.z - AIorigin.z > 0 && attackstate == false) {
rb.AddForce (0, 0, dashspeed * speed * -1, ForceMode.VelocityChange);
} else if (playerorigin.z - AIorigin.z < 0 && attackstate == true) {
rb.AddForce (0, 0, dashspeed * speed * -1, ForceMode.VelocityChange);
} else if (playerorigin.z - AIorigin.z < 0 && attackstate == false) {
rb.AddForce (0, 0, dashspeed * speed, ForceMode.VelocityChange);
}
}
}

}

IEnumerator froze(){
rb.velocity = Vector3.zero;
rb.angularVelocity = Vector3.zero;
rb.isKinematic = true;
cube.GetComponent<Renderer> ().material = Frost;
yield return new WaitForSeconds (2);
rb.isKinematic = false;
freeze = false;
if (cube.tag == "player1") {
cube.GetComponent<Renderer> ().material = red;
} else if (cube.tag == "player2") {
cube.GetComponent<Renderer> ().material = blu;
}
}

}
20 changes: 20 additions & 0 deletions Assets/AImovement.cs.meta

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

9 changes: 9 additions & 0 deletions Assets/Assets.meta

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

9 changes: 9 additions & 0 deletions Assets/Assets/Wispy Sky.meta

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

9 changes: 9 additions & 0 deletions Assets/Assets/Wispy Sky/Materials.meta

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

Loading

0 comments on commit 47b4b7e

Please sign in to comment.