Skip to content

Commit

Permalink
- bugs fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuro-dake committed Aug 5, 2020
1 parent 7e5917c commit b0ab1d2
Show file tree
Hide file tree
Showing 34 changed files with 5,023 additions and 41 deletions.
83 changes: 43 additions & 40 deletions Assets/Scripts/GM.cs → Assets/GM.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
using UnityEngine;
using UnityEngine.UI;



public class GM : MonoBehaviour
{
static GM inst;
private void Start()
{
inst = this;
Initialize();

}
Vector3 shake_center;
void Initialize()
Expand All @@ -25,14 +27,14 @@ private void Update()
ticked = false;
ui_text = player.recharges > 0 ? player.recharges + " remote reset usages left" : "";

if(start_level_routine != null && Input.GetKeyDown(KeyCode.Space))
if (start_level_routine != null && Input.GetKeyDown(KeyCode.Space))
{
StopCoroutine(start_level_routine);
start_level_routine = null;
level_description.Erase();
SetCurtainVisible(false);
debris.RunLevel(debris.run_level);

}
}
public bool intro = false;
Expand Down Expand Up @@ -79,7 +81,7 @@ IEnumerator OutroStep()
{
yield return null;
}

}
void StartLevel(int level)
{
Expand All @@ -91,36 +93,36 @@ void StartLevel(int level)
}
string[] level_names = new string[]
{
"\"Crash landing\"" +
"\n\n" +
"Press Spacebar to skip this text\n\n"+
"Use A and D or left and right cursor keys to move.\n\n" +
"Avoid falling debris!\n\n" +
"Use W or up cursor key to salvage the fallen debris once the timers appear.,\n" +
"You have limited time to salvage each fallen part before it explodes, and destroys all the other debris.",

"\"The ship enters the atmosphere\"\n\n" +
"Watch the order in which the debris hit the ground.\nThe sooner debris falls the sooner it explodes.",

"\"Stasis\"\n\n" +
"You have gained the ability to stop the countdown of a single debris.\nHover with your mouse over the debris you wish to freeze.",

"\"Time freezes\"\n\n" +
"You have gained the ability to reset the debris timers.\nClick the debris of which timer you wish to reset.\n" +
"\nYou can do this three times per wave.\n\n" +
"You have also gained the ability to stop time. Stop moving to freeze time while timers are running.\n\n" +
"Use W or up cursor key to stop time while debris is falling",

"\"The sky is falling down\"\n\n" +
"You have gained the ability to reset any debris timer as many times you want.\n\n" +
"The debris timers will reset once you approach it."
"\"Crash landing\"" +
"\n\n" +
"Press Spacebar to skip this text\n\n"+
"Use A and D or left and right cursor keys to move.\n\n" +
"Avoid falling debris!\n\n" +
"Use W or up cursor key to salvage the fallen debris once the timers appear.,\n" +
"You have limited time to salvage each fallen part before it explodes, and destroys all the other debris.",

"\"The ship enters the atmosphere\"\n\n" +
"Watch the order in which the debris hit the ground.\nThe sooner debris falls the sooner it explodes.",

"\"Stasis\"\n\n" +
"You have gained the ability to stop the countdown of a single debris.\nHover with your mouse over the debris you wish to freeze.",

"\"Time freezes\"\n\n" +
"You have gained the ability to reset the debris timers.\nClick the debris of which timer you wish to reset.\n" +
"\nYou can do this three times per wave.\n\n" +
"You have also gained the ability to stop time. Stop moving to freeze time while timers are running.\n\n" +
"Use W or up cursor key to stop time while debris is falling",

"\"The sky is falling down\"\n\n" +
"You have gained the ability to reset any debris timer as many times you want.\n\n" +
"The debris timers will reset once you approach it."
};
IEnumerator StartLevelStep(int level)
{
yield return new WaitForSeconds(.4f);
level_description.text = "Level " + (level + 1) + ":\n" + level_names[level];
yield return level_description.Write(true);

while (!Input.GetKeyDown(KeyCode.Space))
{
yield return null;
Expand All @@ -143,13 +145,13 @@ IEnumerator StartLevelStep(int level)
IEnumerator ShakeScreenRoutine()
{
float shakescreen_inst = shake_screen_strength;

while (shakescreen_inst > .01f)
{
shakescreen_inst -= Time.fixedDeltaTime * 2;
Camera.main.transform.position = shake_center + new Vector3(Random.Range(-1, 2), Random.Range(-1, 2), 0f) * shakescreen_inst;


yield return null;
}
Camera.main.transform.position = shake_center;
Expand All @@ -176,7 +178,7 @@ public static string ui_text

public static void GameOver()
{
if(game_over_routine != null)
if (game_over_routine != null)
{
inst.StopCoroutine(game_over_routine);
}
Expand All @@ -185,24 +187,24 @@ public static void GameOver()
}
static IEnumerator GameOverStep()
{

Debris.ExplodeAllDebris();
player.StopWarudo();
debris.StopRunLevel();
player.recharges = 0;
yield return SetCurtainVisible(true);
game_over_routine = null;
yield return null;
if(debris.run_level < 5)
if (debris.run_level < 5)
{
inst.StartLevel(debris.run_level);
}
else
{
inst.Outro();
}


}
[SerializeField]
Sprite _circle;
Expand All @@ -224,9 +226,10 @@ public static GameObject CreateCircle()

static bool ticked = false;
static int clock = 1;


public static void Tick() {


public static void Tick()
{
if (ticked)
{
return;
Expand Down Expand Up @@ -260,7 +263,7 @@ public static bool paused
set
{
_paused = value;
if(game_over_routine == null && inst.start_level_routine == null)
if (game_over_routine == null && inst.start_level_routine == null)
{
Time.timeScale = value ? 0f : 1f;
foreach (Image i in inst.pause_icon.GetComponentsInChildren<Image>())
Expand Down
93 changes: 93 additions & 0 deletions Assets/Prefabs/Point Light.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5856352135961977083
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7452236752315678341}
- component: {fileID: 5571020760121886324}
m_Layer: 0
m_Name: Point Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7452236752315678341
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5856352135961977083}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -2.13, y: -2.4, z: -0.22}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!108 &5571020760121886324
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5856352135961977083}
m_Enabled: 1
serializedVersion: 9
m_Type: 2
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 0
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 6570
m_UseColorTemperature: 0
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
7 changes: 7 additions & 0 deletions Assets/Prefabs/Point Light.prefab.meta

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

8 changes: 8 additions & 0 deletions Assets/Prefabs/Rings.meta

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

Loading

0 comments on commit b0ab1d2

Please sign in to comment.