Skip to content
Permalink
Browse files

Sugar Push

Added some health, score and stuff like that.
  • Loading branch information
aps16104 committed Feb 19, 2020
1 parent fb430ba commit fc0ac696684a88f37bd9f0503a26aed97d886119

Large diffs are not rendered by default.

@@ -145,7 +145,7 @@ CircleCollider2D:
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -0.021292627, y: -0.014195174}
@@ -14,7 +14,7 @@ GameObject:
- component: {fileID: 1073888857780383466}
m_Layer: 0
m_Name: Bolt
m_TagString: Untagged
m_TagString: Shot
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
@@ -27,7 +27,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2786470009650213004}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.25, y: 0.75, z: 1}
m_Children:
- {fileID: 5826147667051634208}
@@ -42,7 +42,7 @@ Rigidbody2D:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2786470009650213004}
m_BodyType: 1
m_BodyType: 0
m_Simulated: 1
m_UseFullKinematicContacts: 1
m_UseAutoMass: 0
@@ -10,7 +10,25 @@ void OnTriggerEnter2D(Collider2D other)
{
return;
}
Destroy(other.gameObject);
Destroy(gameObject);
if (other.tag == "Ship")
{
HealthScript.healthValue = HealthScript.healthValue - 25;
other.gameObject.SetActive(true);
Destroy(gameObject);

if (HealthScript.healthValue < 1)
{
other.gameObject.SetActive(false);
}
}

if (other.tag == "Shot")
{
ScoreScript.scoreValue += 1;
Destroy(other.gameObject);
Destroy(gameObject);
}


}
}
@@ -0,0 +1,26 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class HealthScript : MonoBehaviour
{

public static int healthValue = 100;
Text health;
void Start()
{
health = GetComponent<Text>();
}

// Update is called once per frame
void Update()
{
health.text = "Health:" + healthValue;
if (healthValue <= 1)
{
Time.timeScale = 0;
health.text = "Game Over";
}
}
}

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

@@ -9,6 +9,8 @@ public class Boundary
{
public float xMin, xMax, yMin, yMax;
}


public class PlayerController : MonoBehaviour
{
public float speed;
@@ -22,7 +24,8 @@ public class PlayerController : MonoBehaviour

public Text score;

void Update()

void Update()
{
if (Input.GetKeyDown("space") && Time.time > nextFire)
{
@@ -0,0 +1,22 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;


public class ScoreScript : MonoBehaviour
{

public static int scoreValue = 0;
Text score;
void Start()
{
score = GetComponent<Text>();
}

// Update is called once per frame
void Update()
{
score.text = "Score: " + scoreValue;
}
}

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

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

Binary file not shown.
Binary file not shown.
@@ -1246,7 +1246,7 @@ function _emscripten_asm_const_id(code, a0) {
return ASM_CONSTS[code](a0);
}
STATIC_BASE = GLOBAL_BASE;
STATICTOP = STATIC_BASE + 3063392;
STATICTOP = STATIC_BASE + 3066976;
__ATINIT__.push({
func: (function() {
__GLOBAL__sub_I_AccessibilityScriptingClasses_cpp();
@@ -3021,7 +3021,7 @@ __ATINIT__.push({
})
}, {
func: (function() {
__GLOBAL__sub_I_Thread_cpp_85253();
__GLOBAL__sub_I_Thread_cpp_39566();
})
}, {
func: (function() {
@@ -3057,19 +3057,15 @@ __ATINIT__.push({
})
}, {
func: (function() {
__GLOBAL__sub_I_Assembly_cpp_85996();
__GLOBAL__sub_I_Assembly_cpp_40309();
})
}, {
func: (function() {
__GLOBAL__sub_I_MemoryMappedFile_cpp();
})
}, {
func: (function() {
__GLOBAL__sub_I_Runtime_cpp_86615();
})
}, {
func: (function() {
__GLOBAL__sub_I_Il2CppCodeRegistration_cpp();
__GLOBAL__sub_I_Runtime_cpp_40928();
})
}, {
func: (function() {
@@ -3087,8 +3083,12 @@ __ATINIT__.push({
func: (function() {
__GLOBAL__sub_I_Path_cpp();
})
}, {
func: (function() {
__GLOBAL__sub_I_Il2CppCodeRegistration_cpp();
})
});
var STATIC_BUMP = 3063392;
var STATIC_BUMP = 3066976;
Module["STATIC_BASE"] = STATIC_BASE;
Module["STATIC_BUMP"] = STATIC_BUMP;
var tempDoublePtr = STATICTOP;
Module["printErr"]("Build with ASSERTIONS=2 for more info.");
abort(x);
}
Module["wasmTableSize"] = 62076;
Module["wasmMaxTableSize"] = 62076;
Module["wasmTableSize"] = 62079;
Module["wasmMaxTableSize"] = 62079;
function invoke_dddi(index, a1, a2, a3) {
try {
return Module["dynCall_dddi"](index, a1, a2, a3);
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return real___GLOBAL__sub_I_Assembly_cpp.apply(null, arguments);
});
var real___GLOBAL__sub_I_Assembly_cpp_85996 = asm["__GLOBAL__sub_I_Assembly_cpp_85996"];
asm["__GLOBAL__sub_I_Assembly_cpp_85996"] = (function() {
var real___GLOBAL__sub_I_Assembly_cpp_40309 = asm["__GLOBAL__sub_I_Assembly_cpp_40309"];
asm["__GLOBAL__sub_I_Assembly_cpp_40309"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return real___GLOBAL__sub_I_Assembly_cpp_85996.apply(null, arguments);
return real___GLOBAL__sub_I_Assembly_cpp_40309.apply(null, arguments);
});
var real___GLOBAL__sub_I_AssetBundleFileSystem_cpp = asm["__GLOBAL__sub_I_AssetBundleFileSystem_cpp"];
asm["__GLOBAL__sub_I_AssetBundleFileSystem_cpp"] = (function() {
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return real___GLOBAL__sub_I_Runtime_cpp.apply(null, arguments);
});
var real___GLOBAL__sub_I_Runtime_cpp_86615 = asm["__GLOBAL__sub_I_Runtime_cpp_86615"];
asm["__GLOBAL__sub_I_Runtime_cpp_86615"] = (function() {
var real___GLOBAL__sub_I_Runtime_cpp_40928 = asm["__GLOBAL__sub_I_Runtime_cpp_40928"];
asm["__GLOBAL__sub_I_Runtime_cpp_40928"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return real___GLOBAL__sub_I_Runtime_cpp_86615.apply(null, arguments);
return real___GLOBAL__sub_I_Runtime_cpp_40928.apply(null, arguments);
});
var real___GLOBAL__sub_I_Shader_cpp = asm["__GLOBAL__sub_I_Shader_cpp"];
asm["__GLOBAL__sub_I_Shader_cpp"] = (function() {
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return real___GLOBAL__sub_I_Thread_cpp.apply(null, arguments);
});
var real___GLOBAL__sub_I_Thread_cpp_85253 = asm["__GLOBAL__sub_I_Thread_cpp_85253"];
asm["__GLOBAL__sub_I_Thread_cpp_85253"] = (function() {
var real___GLOBAL__sub_I_Thread_cpp_39566 = asm["__GLOBAL__sub_I_Thread_cpp_39566"];
asm["__GLOBAL__sub_I_Thread_cpp_39566"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return real___GLOBAL__sub_I_Thread_cpp_85253.apply(null, arguments);
return real___GLOBAL__sub_I_Thread_cpp_39566.apply(null, arguments);
});
var real___GLOBAL__sub_I_TilemapScriptingClasses_cpp = asm["__GLOBAL__sub_I_TilemapScriptingClasses_cpp"];
asm["__GLOBAL__sub_I_TilemapScriptingClasses_cpp"] = (function() {
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return Module["asm"]["__GLOBAL__sub_I_Assembly_cpp"].apply(null, arguments);
});
var __GLOBAL__sub_I_Assembly_cpp_85996 = Module["__GLOBAL__sub_I_Assembly_cpp_85996"] = (function() {
var __GLOBAL__sub_I_Assembly_cpp_40309 = Module["__GLOBAL__sub_I_Assembly_cpp_40309"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return Module["asm"]["__GLOBAL__sub_I_Assembly_cpp_85996"].apply(null, arguments);
return Module["asm"]["__GLOBAL__sub_I_Assembly_cpp_40309"].apply(null, arguments);
});
var __GLOBAL__sub_I_AssetBundleFileSystem_cpp = Module["__GLOBAL__sub_I_AssetBundleFileSystem_cpp"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return Module["asm"]["__GLOBAL__sub_I_Runtime_cpp"].apply(null, arguments);
});
var __GLOBAL__sub_I_Runtime_cpp_86615 = Module["__GLOBAL__sub_I_Runtime_cpp_86615"] = (function() {
var __GLOBAL__sub_I_Runtime_cpp_40928 = Module["__GLOBAL__sub_I_Runtime_cpp_40928"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return Module["asm"]["__GLOBAL__sub_I_Runtime_cpp_86615"].apply(null, arguments);
return Module["asm"]["__GLOBAL__sub_I_Runtime_cpp_40928"].apply(null, arguments);
});
var __GLOBAL__sub_I_Shader_cpp = Module["__GLOBAL__sub_I_Shader_cpp"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return Module["asm"]["__GLOBAL__sub_I_Thread_cpp"].apply(null, arguments);
});
var __GLOBAL__sub_I_Thread_cpp_85253 = Module["__GLOBAL__sub_I_Thread_cpp_85253"] = (function() {
var __GLOBAL__sub_I_Thread_cpp_39566 = Module["__GLOBAL__sub_I_Thread_cpp_39566"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
assert(!runtimeExited, "the runtime was exited (use NO_EXIT_RUNTIME to keep it alive after main() exits)");
return Module["asm"]["__GLOBAL__sub_I_Thread_cpp_85253"].apply(null, arguments);
return Module["asm"]["__GLOBAL__sub_I_Thread_cpp_39566"].apply(null, arguments);
});
var __GLOBAL__sub_I_TilemapScriptingClasses_cpp = Module["__GLOBAL__sub_I_TilemapScriptingClasses_cpp"] = (function() {
assert(runtimeInitialized, "you need to wait for the runtime to be ready (e.g. wait for main() to be called)");
@@ -5,6 +5,9 @@ TagManager:
serializedVersion: 2
tags:
- Shot
- Asteroid
- Boundary
- Ship
layers:
- Default
- TransparentFX

0 comments on commit fc0ac69

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