diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..4edd970 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,56 @@ +{ + "files.exclude": + { + "**/.DS_Store":true, + "**/.git":true, + "**/.gitignore":true, + "**/.gitmodules":true, + "**/*.booproj":true, + "**/*.pidb":true, + "**/*.suo":true, + "**/*.user":true, + "**/*.userprefs":true, + "**/*.unityproj":true, + "**/*.dll":true, + "**/*.exe":true, + "**/*.pdf":true, + "**/*.mid":true, + "**/*.midi":true, + "**/*.wav":true, + "**/*.gif":true, + "**/*.ico":true, + "**/*.jpg":true, + "**/*.jpeg":true, + "**/*.png":true, + "**/*.psd":true, + "**/*.tga":true, + "**/*.tif":true, + "**/*.tiff":true, + "**/*.3ds":true, + "**/*.3DS":true, + "**/*.fbx":true, + "**/*.FBX":true, + "**/*.lxo":true, + "**/*.LXO":true, + "**/*.ma":true, + "**/*.MA":true, + "**/*.obj":true, + "**/*.OBJ":true, + "**/*.asset":true, + "**/*.cubemap":true, + "**/*.flare":true, + "**/*.mat":true, + "**/*.meta":true, + "**/*.prefab":true, + "**/*.unity":true, + "build/":true, + "Build/":true, + "Library/":true, + "library/":true, + "obj/":true, + "Obj/":true, + "ProjectSettings/":true, + "temp/":true, + "Temp/":true + } +} \ No newline at end of file diff --git a/Assets/Arrow2.png b/Assets/Arrow2.png new file mode 100644 index 0000000..8aabeca Binary files /dev/null and b/Assets/Arrow2.png differ diff --git a/Assets/Arrow2.png.meta b/Assets/Arrow2.png.meta new file mode 100644 index 0000000..c808548 --- /dev/null +++ b/Assets/Arrow2.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 50d7e7554294e2942bdf0c993bcfaf01 +timeCreated: 1524210344 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 5 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 25 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Graphics/Text/PlaceHolder/Thumbs.db.meta b/Assets/Graphics/Text/PlaceHolder/Thumbs.db.meta deleted file mode 100644 index 3537713..0000000 --- a/Assets/Graphics/Text/PlaceHolder/Thumbs.db.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: 5a4c43bf350432a429db0128a21ecea5 -timeCreated: 1440777891 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Graphics/Thumbs.db.meta b/Assets/Graphics/Thumbs.db.meta deleted file mode 100644 index 6fe131a..0000000 --- a/Assets/Graphics/Thumbs.db.meta +++ /dev/null @@ -1,8 +0,0 @@ -fileFormatVersion: 2 -guid: bd91c125519aa63479a91764aa5a5d52 -timeCreated: 1454524385 -licenseType: Free -DefaultImporter: - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/MinimapArrowTemp.png b/Assets/MinimapArrowTemp.png new file mode 100644 index 0000000..3ba4e39 Binary files /dev/null and b/Assets/MinimapArrowTemp.png differ diff --git a/Assets/MinimapArrowTemp.png.meta b/Assets/MinimapArrowTemp.png.meta new file mode 100644 index 0000000..c029d17 --- /dev/null +++ b/Assets/MinimapArrowTemp.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: 7a66a77192d1c0842a7856157c90f7eb +timeCreated: 1524208159 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 1000 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Outside_arrows_revised.png b/Assets/Outside_arrows_revised.png new file mode 100644 index 0000000..a08a067 Binary files /dev/null and b/Assets/Outside_arrows_revised.png differ diff --git a/Assets/Outside_arrows_revised.png.meta b/Assets/Outside_arrows_revised.png.meta new file mode 100644 index 0000000..32f8768 --- /dev/null +++ b/Assets/Outside_arrows_revised.png.meta @@ -0,0 +1,98 @@ +fileFormatVersion: 2 +guid: ef00890c0a932ee4ebf01eef4fca21f2 +timeCreated: 1524210027 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: -1 + aniso: -1 + mipBias: -1 + wrapU: 1 + wrapV: 1 + wrapW: 1 + nPOTScale: 0 + lightmap: 0 + compressionQuality: 50 + spriteMode: 1 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 5 + spritePivot: {x: 0.5, y: 0.5} + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spritePixelsToUnits: 250 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Standalone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: iPhone + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + - buildTarget: Android + maxTextureSize: 2048 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/Arrow.prefab b/Assets/Prefabs/Arrow.prefab new file mode 100644 index 0000000..62498ea Binary files /dev/null and b/Assets/Prefabs/Arrow.prefab differ diff --git a/Assets/Prefabs/Arrow.prefab.meta b/Assets/Prefabs/Arrow.prefab.meta new file mode 100644 index 0000000..b452775 --- /dev/null +++ b/Assets/Prefabs/Arrow.prefab.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 9005b99f7ec1e6b40a6e2c9d69373cc8 +timeCreated: 1524208178 +licenseType: Free +NativeFormatImporter: + mainObjectFileID: 100100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/BallistaEnemy.prefab b/Assets/Prefabs/BallistaEnemy.prefab index 0f0156d..80bf400 100644 Binary files a/Assets/Prefabs/BallistaEnemy.prefab and b/Assets/Prefabs/BallistaEnemy.prefab differ diff --git a/Assets/Prefabs/Enemy.prefab b/Assets/Prefabs/Enemy.prefab index d79ad76..4a513bc 100644 Binary files a/Assets/Prefabs/Enemy.prefab and b/Assets/Prefabs/Enemy.prefab differ diff --git a/Assets/Prefabs/TripleShotEnemy.prefab b/Assets/Prefabs/TripleShotEnemy.prefab index d7dc80b..87899f5 100644 Binary files a/Assets/Prefabs/TripleShotEnemy.prefab and b/Assets/Prefabs/TripleShotEnemy.prefab differ diff --git a/Assets/Scenes/Level1-Village.unity b/Assets/Scenes/Level1-Village.unity index 911dc10..b24d791 100644 Binary files a/Assets/Scenes/Level1-Village.unity and b/Assets/Scenes/Level1-Village.unity differ diff --git a/Assets/Scripts/DetectableObject.cs b/Assets/Scripts/DetectableObject.cs new file mode 100644 index 0000000..9d3493a --- /dev/null +++ b/Assets/Scripts/DetectableObject.cs @@ -0,0 +1,78 @@ +using UnityEngine; +using System.Collections; + +public class DetectableObject : MonoBehaviour +{ + //How fast does the object need to be to actually be detectable + public float SpeedThreshhold; + //How close the object needs to be to actually be detectable + public float DetectionRange = 100; + //Prefab for graphic displaying the direction the object is in. + public GameObject arrowPrefab; + //private PlayerWithinRangeOfEnemy _playerWithinRangeScript; + //Cached components to reduce slow GetComponent() calls. + [SerializeField] + Renderer _renderer; + //Rigidbody2D _rb2d; + GameObject _arrow; + + /* + Cache all needed components. + */ + void Start() + { + _renderer = GetComponent(); + //_rb2d = GetComponent(); + _arrow = (GameObject)Instantiate(arrowPrefab); + _arrow.SetActive(false); + //_playerWithinRangeScript = GameObject.FindGameObjectWithTag("CommentaryObject").GetComponentInChildren(); + } + /* + Check if this object meets all conditions. If yes, show arrow and update its position. + Else, hide arrow. + ***Technically, this checks the distance between this object and the center of the screen, + ***not the player's actual position. + */ + void Update() + { + //Gets the center of the screen in world position + Vector3 playerPos = Camera.main.ViewportToWorldPoint(new Vector3(0.5f, 0.5f, 0)); + Vector3 objectPos = transform.position; + + //Gets how far the object is away from center of the screen. + Vector3 heading = objectPos - playerPos; + float distance = heading.magnitude; + + //Checks if this object: + //1) Is close enough to be detected + //2) Is actually outside the screen/not rendered by the camera + //3) Is moving faster than the speed threshhold + if (distance <= DetectionRange && !_renderer.isVisible)// && _rb2d.velocity.magnitude >= SpeedThreshhold) + { + _arrow.SetActive(true); + UpdateArrow(); + } + else + { + _arrow.SetActive(false); + } + } + /* + Update arrow's position and rotation. + */ + public void UpdateArrow() + { + //Grabs this object's position and clamps it to the edge of the screen. + + Vector3 pos = transform.position; + pos = Camera.main.WorldToViewportPoint(pos); + pos.x = Mathf.Clamp01(pos.x); + pos.y = Mathf.Clamp01(pos.y); + + _arrow.transform.position = Camera.main.ViewportToWorldPoint(pos); + + pos = _arrow.transform.position; + float Angle = Mathf.Atan2(transform.position.y - pos.y, transform.position.x - pos.x) * 180 / Mathf.PI; + _arrow.transform.rotation = Quaternion.Euler(new Vector3(0, 0, Angle)); + } +} \ No newline at end of file diff --git a/Assets/Scripts/DetectableObject.cs.meta b/Assets/Scripts/DetectableObject.cs.meta new file mode 100644 index 0000000..5419184 --- /dev/null +++ b/Assets/Scripts/DetectableObject.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 200c632cae2e3c948ba5c5941bc2b73c +timeCreated: 1524207090 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Lvl1Tutorial.cs b/Assets/Scripts/Lvl1Tutorial.cs index 094fa64..174e434 100644 --- a/Assets/Scripts/Lvl1Tutorial.cs +++ b/Assets/Scripts/Lvl1Tutorial.cs @@ -10,6 +10,7 @@ public class Lvl1Tutorial : MonoBehaviour { public bool tutArrowCaught = false; public bool displayText2 = true; public bool displayText3 = true; + public float ControllsReminderTime; //these are the spawn points in the level public GameObject s1,s2,s3,s4,s5,s6,s7,s8,s9,s10,s11,s12; //tutorialSpawn.GetComponent().EnemyCheck == false @@ -74,5 +75,23 @@ void DisplayDefendText() void RemoveText() { tutorialText3.gameObject.SetActive(false); + StartCoroutine(CoWaitToRemindControlls()); + } + + IEnumerator CoWaitToRemindControlls() + { + while(true) + { + yield return new WaitForSeconds(ControllsReminderTime); + tutorialText.gameObject.SetActive(true); + yield return new WaitForSeconds(8); + tutorialText.gameObject.SetActive(false); + tutorialText2.gameObject.SetActive(true); + yield return new WaitForSeconds(8); + tutorialText2.gameObject.SetActive(false); + tutorialText3.gameObject.SetActive(true); + yield return new WaitForSeconds(8); + tutorialText3.gameObject.SetActive(false); + } } } diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index eccb28b..20e67d9 100644 Binary files a/ProjectSettings/ProjectSettings.asset and b/ProjectSettings/ProjectSettings.asset differ diff --git a/ProjectSettings/ProjectVersion.txt b/ProjectSettings/ProjectVersion.txt index d0aa952..27997c5 100644 --- a/ProjectSettings/ProjectVersion.txt +++ b/ProjectSettings/ProjectVersion.txt @@ -1,2 +1 @@ -m_EditorVersion: 5.3.2p1 -m_StandardAssetsVersion: 0 +m_EditorVersion: 2017.3.1f1 diff --git a/ProjectSettings/UnityAdsSettings.asset b/ProjectSettings/UnityAdsSettings.asset deleted file mode 100644 index e6070fc..0000000 Binary files a/ProjectSettings/UnityAdsSettings.asset and /dev/null differ diff --git a/UnityPackageManager/manifest.json b/UnityPackageManager/manifest.json new file mode 100644 index 0000000..526aca6 --- /dev/null +++ b/UnityPackageManager/manifest.json @@ -0,0 +1,4 @@ +{ + "dependencies": { + } +}