diff --git a/GGJ17/Assets/Fonts/Perfect DOS VGA 437 Win.ttf b/GGJ17/Assets/Fonts/Perfect DOS VGA 437 Win.ttf new file mode 100644 index 0000000..d03b1c5 Binary files /dev/null and b/GGJ17/Assets/Fonts/Perfect DOS VGA 437 Win.ttf differ diff --git a/GGJ17/Assets/Fonts/Perfect DOS VGA 437 Win.ttf.meta b/GGJ17/Assets/Fonts/Perfect DOS VGA 437 Win.ttf.meta new file mode 100644 index 0000000..c3a327a --- /dev/null +++ b/GGJ17/Assets/Fonts/Perfect DOS VGA 437 Win.ttf.meta @@ -0,0 +1,21 @@ +fileFormatVersion: 2 +guid: d3636e771f4e8924ca50df2d5c3d5c84 +timeCreated: 1485082425 +licenseType: Free +TrueTypeFontImporter: + serializedVersion: 4 + fontSize: 16 + forceTextureCase: -2 + characterSpacing: 0 + characterPadding: 1 + includeFontData: 1 + fontName: Perfect DOS VGA 437 Win + fontNames: + - Perfect DOS VGA 437 Win + fallbackFontReferences: [] + customCharacters: + fontRenderingMode: 0 + ascentCalculationMode: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Images/EnemyFire.png b/GGJ17/Assets/Images/EnemyFire.png new file mode 100644 index 0000000..9f0bcea Binary files /dev/null and b/GGJ17/Assets/Images/EnemyFire.png differ diff --git a/GGJ17/Assets/Images/EnemyFire.png.meta b/GGJ17/Assets/Images/EnemyFire.png.meta new file mode 100644 index 0000000..f58d3d3 --- /dev/null +++ b/GGJ17/Assets/Images/EnemyFire.png.meta @@ -0,0 +1,76 @@ +fileFormatVersion: 2 +guid: 5095a5a84f2a7c240b05031bef38efb4 +timeCreated: 1485089462 +licenseType: Free +TextureImporter: + fileIDToRecycleName: {} + serializedVersion: 4 + mipmaps: + mipMapMode: 0 + enableMipMap: 0 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + 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: + filterMode: 1 + aniso: -1 + mipBias: -1 + wrapMode: 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: 100 + alphaUsage: 0 + 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 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + spritePackingTag: + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Material/EnemyFire.mat b/GGJ17/Assets/Material/EnemyFire.mat new file mode 100644 index 0000000..eea2763 Binary files /dev/null and b/GGJ17/Assets/Material/EnemyFire.mat differ diff --git a/GGJ17/Assets/Material/EnemyFire.mat.meta b/GGJ17/Assets/Material/EnemyFire.mat.meta new file mode 100644 index 0000000..f102cd3 --- /dev/null +++ b/GGJ17/Assets/Material/EnemyFire.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 36b7dfbfa0cf14646b131fce11345ce2 +timeCreated: 1485089254 +licenseType: Free +NativeFormatImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab b/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab index bb981bc..2e0e0f9 100644 Binary files a/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab and b/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab differ diff --git a/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab.meta b/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab.meta index aac4150..29b8696 100644 --- a/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab.meta +++ b/GGJ17/Assets/Prefab/Dialog/Dialog Left.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 -guid: 07c11a70a8018164ca777bfa04052c4f -timeCreated: 1485023801 +guid: 68681d1e82ea27d469ea9665ff7ac4b1 +timeCreated: 1485079683 licenseType: Free NativeFormatImporter: userData: diff --git a/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab b/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab index 84016b4..5fce198 100644 Binary files a/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab and b/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab differ diff --git a/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab.meta b/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab.meta index bdd96b0..9041da8 100644 --- a/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab.meta +++ b/GGJ17/Assets/Prefab/Dialog/Dialog Right.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: c43fa688a71d0cd4988e71c9075226a4 -timeCreated: 1485023976 +timeCreated: 1485079809 licenseType: Free NativeFormatImporter: userData: diff --git a/GGJ17/Assets/Prefab/Dialog/Dialog.prefab b/GGJ17/Assets/Prefab/Dialog/Dialog.prefab index 0cc49eb..13e08d4 100644 Binary files a/GGJ17/Assets/Prefab/Dialog/Dialog.prefab and b/GGJ17/Assets/Prefab/Dialog/Dialog.prefab differ diff --git a/GGJ17/Assets/Prefab/Dialog/Dialog.prefab.meta b/GGJ17/Assets/Prefab/Dialog/Dialog.prefab.meta index 30fb4f6..e87cecc 100644 --- a/GGJ17/Assets/Prefab/Dialog/Dialog.prefab.meta +++ b/GGJ17/Assets/Prefab/Dialog/Dialog.prefab.meta @@ -1,6 +1,6 @@ fileFormatVersion: 2 guid: a8148190d06b1484bac1b82675ada2e2 -timeCreated: 1485045754 +timeCreated: 1485082671 licenseType: Free NativeFormatImporter: userData: diff --git a/GGJ17/Assets/Prefab/King.prefab b/GGJ17/Assets/Prefab/King.prefab index 5d0b701..33b6a2f 100644 Binary files a/GGJ17/Assets/Prefab/King.prefab and b/GGJ17/Assets/Prefab/King.prefab differ diff --git a/GGJ17/Assets/Prefab/Soldier.prefab b/GGJ17/Assets/Prefab/Soldier.prefab index 6e2c096..07ad4db 100644 Binary files a/GGJ17/Assets/Prefab/Soldier.prefab and b/GGJ17/Assets/Prefab/Soldier.prefab differ diff --git a/GGJ17/Assets/Scene/IntroScene.unity b/GGJ17/Assets/Scene/IntroScene.unity index ac47402..8227efc 100644 Binary files a/GGJ17/Assets/Scene/IntroScene.unity and b/GGJ17/Assets/Scene/IntroScene.unity differ diff --git a/GGJ17/Assets/Scene/Marky.unity b/GGJ17/Assets/Scene/Marky.unity index 073a8f1..d6ada80 100644 Binary files a/GGJ17/Assets/Scene/Marky.unity and b/GGJ17/Assets/Scene/Marky.unity differ diff --git a/GGJ17/Assets/Script/AttackBehaviour.cs b/GGJ17/Assets/Script/AttackBehaviour.cs new file mode 100644 index 0000000..b4d0be2 --- /dev/null +++ b/GGJ17/Assets/Script/AttackBehaviour.cs @@ -0,0 +1,88 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +[RequireComponent(typeof(LineRenderer))] +public class AttackBehaviour : MonoBehaviour { + + public Transform target; + LineRenderer lr; + + bool canSee; + + public float delay; + public float damage; + + void Start () { + lr = GetComponent(); + lr.enabled = false; + + StartCoroutine(inRange()); + StartCoroutine(attack()); + } + + public void startAttack(Transform target) + { + this.target = target; + } + + void Update() + { + lr.enabled = target != null; + + if (lr.enabled) + { + Vector3[] positions = new Vector3[2]; + + positions[0] = transform.position; + positions[1] = target.position; + + lr.SetPositions(positions); + } + } + + public void stopAttack() + { + target = null; + } + + IEnumerator inRange() + { + while(true) + { + if (target) + { + Vector3 dist = target.position - transform.position; + + canSee = !Physics.Raycast(transform.position, dist.normalized, dist.magnitude - 1); + lr.enabled = canSee; + } + else + { + canSee = false; + } + + yield return new WaitForSeconds(0.25f); + } + } + + IEnumerator attack() + { + while(true) + { + if(target && canSee) + { + AbstractBaseBuilding t = target.GetComponent(); + if(t) + { + t.HP -= damage; + } + + yield return new WaitForSeconds(delay); + } + + yield return null; + } + + } +} diff --git a/GGJ17/Assets/Script/AttackBehaviour.cs.meta b/GGJ17/Assets/Script/AttackBehaviour.cs.meta new file mode 100644 index 0000000..4cb1232 --- /dev/null +++ b/GGJ17/Assets/Script/AttackBehaviour.cs.meta @@ -0,0 +1,12 @@ +fileFormatVersion: 2 +guid: 1340ec4410076c14c8b06be8f64ad088 +timeCreated: 1485086127 +licenseType: Free +MonoImporter: + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Script/Blocks/AbstractBaseBuilding.cs b/GGJ17/Assets/Script/Blocks/AbstractBaseBuilding.cs index 3ce1b8a..1df4965 100644 --- a/GGJ17/Assets/Script/Blocks/AbstractBaseBuilding.cs +++ b/GGJ17/Assets/Script/Blocks/AbstractBaseBuilding.cs @@ -8,16 +8,17 @@ public abstract class AbstractBaseBuilding : AbstractBuildingBlock { private float hp = 10; public float HP { + get { return hp; } set { hp = value; - if (hp < value) + if (hp < 0) { DestroyBuilding(); } } - } - + } + public void DestroyBuilding() { diff --git a/GGJ17/Assets/Script/Dialog/Dialog.cs b/GGJ17/Assets/Script/Dialog/Dialog.cs index acd8646..2384a40 100644 --- a/GGJ17/Assets/Script/Dialog/Dialog.cs +++ b/GGJ17/Assets/Script/Dialog/Dialog.cs @@ -47,7 +47,10 @@ public IEnumerator Talk() yield return StartCoroutine(MoveDialogBox(rect, new Vector3(rect.anchoredPosition.x, - -rect.rect.height / 2 - (i * rect.rect.height) - 14))); + -rect.rect.height / 2 - (i * rect.rect.height) - 30))); + + rect.anchoredPosition = new Vector3(rect.rect.width / 2 + 17, + -rect.rect.height / 2 - (i * rect.rect.height) - 30 - 15*i); DialogBox d = box.GetComponent(); d.text = speeches[i].text; @@ -64,6 +67,16 @@ public IEnumerator MoveDialogBox(RectTransform rect, Vector3 target) } } + public void Reset() + { + foreach(DialogBox d in FindObjectsOfType()) + { + Destroy(d.gameObject); + } + + speeches.Clear(); + } + internal void Clear() { speeches.Clear(); diff --git a/GGJ17/Assets/Script/IntroSequence.cs b/GGJ17/Assets/Script/IntroSequence.cs index b2bf181..c4e93a5 100644 --- a/GGJ17/Assets/Script/IntroSequence.cs +++ b/GGJ17/Assets/Script/IntroSequence.cs @@ -1,7 +1,8 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; - +using UnityEngine.SceneManagement; + public class IntroSequence : MonoBehaviour { @@ -50,5 +51,36 @@ public IEnumerator PlayIntro() d.speeches.Add(e); yield return StartCoroutine(d.Talk()); + + d.Reset(); + + e = new Dialog.DialogElement(); + e.dialogBox = d.dialogBoxes[1]; + e.text = "Mission control, we are now entering Psion's orbit."; + d.speeches.Add(e); + + e = new Dialog.DialogElement(); + e.dialogBox = d.dialogBoxes[1]; + e.text = "Mission control, please come in! We are just above Psion..... Do you copy?"; + d.speeches.Add(e); + + e = new Dialog.DialogElement(); + e.dialogBox = d.dialogBoxes[1]; + e.text = "They are not answering!"; + d.speeches.Add(e); + + e = new Dialog.DialogElement(); + e.dialogBox = d.dialogBoxes[1]; + e.text = "Check the main systems!"; + d.speeches.Add(e); + + e = new Dialog.DialogElement(); + e.dialogBox = d.dialogBoxes[1]; + e.text = "Whate the ...? Something has fried our computer! We are coming down hard. Brace for impact."; + d.speeches.Add(e); + + yield return StartCoroutine(d.Talk()); + + SceneManager.LoadScene(2, LoadSceneMode.Single); } } diff --git a/GGJ17/Assets/Script/KingBehaviour.cs b/GGJ17/Assets/Script/KingBehaviour.cs index a031afc..efde99e 100644 --- a/GGJ17/Assets/Script/KingBehaviour.cs +++ b/GGJ17/Assets/Script/KingBehaviour.cs @@ -86,12 +86,12 @@ IEnumerator scanForTarget() if (!Physics.Raycast(my.pos, dist.normalized, dist.magnitude - 1)) { - //Debug.DrawLine(my.pos, a.transform.position, Color.red); + Debug.DrawLine(my.pos, a.transform.position, Color.red); possibleTargets.Add(a.transform); } else { - //Debug.DrawLine(my.pos, a.transform.position, Color.blue); + Debug.DrawLine(my.pos, a.transform.position, Color.blue); if (possibleTargets.Contains(a.transform)) possibleTargets.Remove(a.transform); } } @@ -112,9 +112,7 @@ IEnumerator scanForTarget() bestTarget = possible; } - Debug.Log(mySeek.target = bestTarget); - - if (!mySeek.target || + if (!mySeek.target || !possibleTargets.Contains(mySeek.target) || getPriority(bestTarget) > getPriority(mySeek.target) || (getPriority(bestTarget) == getPriority(mySeek.target) && Vector3.Distance(my.pos, bestTarget.position) <= Vector3.Distance(my.pos, mySeek.target.position))) mySeek.target = bestTarget; @@ -146,10 +144,29 @@ IEnumerator stateMachineManager() { state = KingState.Attack; mySeek.stop(); + + foreach(MyPhysics soldier in army) + { + AttackBehaviour ah = soldier.GetComponent(); + if (ah) ah.startAttack(mySeek.target); + } + } break; case KingState.Attack: + if (!mySeek.target) + { + state = KingState.Seeking; + mySeek.start(); + + foreach (MyPhysics soldier in army) + { + AttackBehaviour ah = soldier.GetComponent(); + if (ah) ah.startAttack(mySeek.target); + } + } + break; } diff --git a/GGJ17/Assets/Script/WorldControl.meta b/GGJ17/Assets/Sounds.meta similarity index 67% rename from GGJ17/Assets/Script/WorldControl.meta rename to GGJ17/Assets/Sounds.meta index a651a32..6c1535d 100644 --- a/GGJ17/Assets/Script/WorldControl.meta +++ b/GGJ17/Assets/Sounds.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 026ecd435f5e8484da51e65011b7b01b +guid: 4ccf198d154d0a446868376c06b52aeb folderAsset: yes -timeCreated: 1485043945 +timeCreated: 1485088973 licenseType: Free DefaultImporter: userData: diff --git a/GGJ17/Assets/Sounds/Blocks.meta b/GGJ17/Assets/Sounds/Blocks.meta new file mode 100644 index 0000000..4916d7f --- /dev/null +++ b/GGJ17/Assets/Sounds/Blocks.meta @@ -0,0 +1,9 @@ +fileFormatVersion: 2 +guid: 733059582f36ad64cb378072835eb072 +folderAsset: yes +timeCreated: 1485089142 +licenseType: Free +DefaultImporter: + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Sounds/Blocks/build_defense.wav b/GGJ17/Assets/Sounds/Blocks/build_defense.wav new file mode 100644 index 0000000..022a5d4 Binary files /dev/null and b/GGJ17/Assets/Sounds/Blocks/build_defense.wav differ diff --git a/GGJ17/Assets/Sounds/Blocks/build_defense.wav.meta b/GGJ17/Assets/Sounds/Blocks/build_defense.wav.meta new file mode 100644 index 0000000..fa484fe --- /dev/null +++ b/GGJ17/Assets/Sounds/Blocks/build_defense.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: f826f39fd5ea69b43a5a4217987bed4a +timeCreated: 1485089144 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Sounds/Blocks/build_extractor.wav b/GGJ17/Assets/Sounds/Blocks/build_extractor.wav new file mode 100644 index 0000000..fc8edc8 Binary files /dev/null and b/GGJ17/Assets/Sounds/Blocks/build_extractor.wav differ diff --git a/GGJ17/Assets/Sounds/Blocks/build_extractor.wav.meta b/GGJ17/Assets/Sounds/Blocks/build_extractor.wav.meta new file mode 100644 index 0000000..4f7ea81 --- /dev/null +++ b/GGJ17/Assets/Sounds/Blocks/build_extractor.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 4b1d423f1abbe0a4dbd9b79d6fe3cc21 +timeCreated: 1485089143 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Sounds/Blocks/build_wall.wav b/GGJ17/Assets/Sounds/Blocks/build_wall.wav new file mode 100644 index 0000000..4a33171 Binary files /dev/null and b/GGJ17/Assets/Sounds/Blocks/build_wall.wav differ diff --git a/GGJ17/Assets/Sounds/Blocks/build_wall.wav.meta b/GGJ17/Assets/Sounds/Blocks/build_wall.wav.meta new file mode 100644 index 0000000..7d29dcc --- /dev/null +++ b/GGJ17/Assets/Sounds/Blocks/build_wall.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 6258f497b7a1ca24abede8f4e0e75e93 +timeCreated: 1485089143 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Sounds/alien.wav b/GGJ17/Assets/Sounds/alien.wav new file mode 100644 index 0000000..8f7e872 Binary files /dev/null and b/GGJ17/Assets/Sounds/alien.wav differ diff --git a/GGJ17/Assets/Sounds/alien.wav.meta b/GGJ17/Assets/Sounds/alien.wav.meta new file mode 100644 index 0000000..127770b --- /dev/null +++ b/GGJ17/Assets/Sounds/alien.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: 0d684d3154d4ba942aa1ecfadda63ab5 +timeCreated: 1485089143 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/Assets/Sounds/android.wav b/GGJ17/Assets/Sounds/android.wav new file mode 100644 index 0000000..f558ca1 Binary files /dev/null and b/GGJ17/Assets/Sounds/android.wav differ diff --git a/GGJ17/Assets/Sounds/android.wav.meta b/GGJ17/Assets/Sounds/android.wav.meta new file mode 100644 index 0000000..9c1728c --- /dev/null +++ b/GGJ17/Assets/Sounds/android.wav.meta @@ -0,0 +1,22 @@ +fileFormatVersion: 2 +guid: d087dc0bb2b1b24498fcedb7dd33dc2f +timeCreated: 1485089144 +licenseType: Free +AudioImporter: + serializedVersion: 6 + defaultSettings: + loadType: 0 + sampleRateSetting: 0 + sampleRateOverride: 44100 + compressionFormat: 1 + quality: 1 + conversionMode: 0 + platformSettingOverrides: {} + forceToMono: 0 + normalize: 1 + preloadAudioData: 1 + loadInBackground: 0 + 3D: 1 + userData: + assetBundleName: + assetBundleVariant: diff --git a/GGJ17/ProjectSettings/EditorBuildSettings.asset b/GGJ17/ProjectSettings/EditorBuildSettings.asset index be54585..21b6bfe 100644 Binary files a/GGJ17/ProjectSettings/EditorBuildSettings.asset and b/GGJ17/ProjectSettings/EditorBuildSettings.asset differ