Skip to content

Commit

Permalink
Merge pull request #170 from IceTheGameDev/add-health-powerups-to-inf…
Browse files Browse the repository at this point in the history
…inite

Add health powerups to infinite
  • Loading branch information
IceTheCoder authored Sep 2, 2023
2 parents 23c1903 + 15b5c19 commit 996c4fb
Show file tree
Hide file tree
Showing 17 changed files with 282 additions and 1,373 deletions.
15 changes: 15 additions & 0 deletions light-game-unity-project/Assets/Prefabs/Health Power-Up.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ GameObject:
- component: {fileID: 3296990597806685345}
- component: {fileID: 8713614175029963767}
- component: {fileID: 6158760880329053389}
- component: {fileID: 5992097893890939452}
m_Layer: 0
m_Name: Health Power-Up
m_TagString: Health
Expand Down Expand Up @@ -221,3 +222,17 @@ PolygonCollider2D:
- {x: 0.11999999, y: -0.060000002}
- {x: 0.14999999, y: -0.060000002}
m_UseDelaunayMesh: 0
--- !u!114 &5992097893890939452
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1938345861627456285}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b97052b71212d1d45b60dfb295aaaf2a, type: 3}
m_Name:
m_EditorClassIdentifier:
points: 8
spawner: {fileID: 0}
2 changes: 1 addition & 1 deletion light-game-unity-project/Assets/Scenes/0 MainMenu.unity
Original file line number Diff line number Diff line change
Expand Up @@ -2465,7 +2465,7 @@ MonoBehaviour:
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: beta-7.0
m_text: beta-7.1
m_isRightToLeft: 0
m_fontAsset: {fileID: 11400000, guid: 5302535af1044152a457ed104f1f4b91, type: 2}
m_sharedMaterial: {fileID: 2164040, guid: 5302535af1044152a457ed104f1f4b91, type: 2}
Expand Down
134 changes: 132 additions & 2 deletions light-game-unity-project/Assets/Scenes/10 InfiniteLevel.unity
Original file line number Diff line number Diff line change
Expand Up @@ -788,7 +788,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 1}
m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 511.58994, y: -75}
m_AnchoredPosition: {x: 500, y: -50}
m_SizeDelta: {x: 897.18, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &627887723
Expand Down Expand Up @@ -901,6 +901,108 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
text: {fileID: 627887723}
--- !u!1001 &1344174440
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1938345861627456285, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_Name
value: Health Power-Up
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_RootOrder
value: 10
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalPosition.z
value: -0.1
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1938345861627456355, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 2360893899511397221, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: spawner
value:
objectReference: {fileID: 4660029137281977076}
- target: {fileID: 3296990597806685345, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: lightCalculator
value:
objectReference: {fileID: 1359693639}
- target: {fileID: 3296990597806685345, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: triangleCollision
value:
objectReference: {fileID: 1359693637}
- target: {fileID: 5992097893890939452, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
propertyPath: spawner
value:
objectReference: {fileID: 4660029137281977076}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents:
- targetCorrespondingSourceObject: {fileID: 1938345861627456285, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
insertIndex: 6
addedObject: {fileID: 2068005884}
m_SourcePrefab: {fileID: 100100000, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
--- !u!114 &1359693637 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3275313659899705819, guid: f09fdf1b6f5433146b987cc1edbae03b, type: 3}
m_PrefabInstance: {fileID: 3275313660358608613}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c960d12dfab7ad048839af35d32208bf, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &1359693639 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3275313659899705822, guid: f09fdf1b6f5433146b987cc1edbae03b, type: 3}
m_PrefabInstance: {fileID: 3275313660358608613}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: efc1f85a0744f3d478c350666221d29d, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &1373767841
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1058,6 +1160,23 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &2068005877 stripped
GameObject:
m_CorrespondingSourceObject: {fileID: 1938345861627456285, guid: b18b0ebed75f6b549a8a65fba424df38, type: 3}
m_PrefabInstance: {fileID: 1344174440}
m_PrefabAsset: {fileID: 0}
--- !u!114 &2068005884
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2068005877}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c2e6c116a096692478eeee39d50f4c30, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &3028133987222170939
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -1338,7 +1457,7 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 4497580048321225807, guid: 9679916696fb4494fad230dd6d908aae, type: 3}
propertyPath: m_AnchoredPosition.y
value: -75
value: -50
objectReference: {fileID: 0}
- target: {fileID: 4497580048321225807, guid: 9679916696fb4494fad230dd6d908aae, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
Expand Down Expand Up @@ -1418,6 +1537,17 @@ PrefabInstance:
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: edc1c382220684e0194d894faf410832, type: 3}
--- !u!114 &4660029137281977076 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 4660029136773146600, guid: edc1c382220684e0194d894faf410832, type: 3}
m_PrefabInstance: {fileID: 4660029137281977075}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5394f90e0f00445fb94806e56455a0bc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1001 &5810375602115766713
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
14 changes: 14 additions & 0 deletions light-game-unity-project/Assets/Scripts/DisableIfFewEnemies.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class DestroyIfFewEnemies : MonoBehaviour
{
void Start()
{
if (EnemySpawner.Instance.currentEnemyCount < 8)
{
Destroy(gameObject);
}
}
}

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

2 changes: 1 addition & 1 deletion light-game-unity-project/Assets/Scripts/HealthPowerUp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void OnTriggerStay2D(Collider2D collision)
{
if (collision.CompareTag("Light") && lightCalculator.won == false)
{
triangleCollision.health = 1f;
triangleCollision.health = 1.5f;
triangleCollision.UpdateText(true);
Destroy(gameObject, destroyDelay);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public class SpawnAndPointProjectiles : MonoBehaviour
public GameObject projectilePrefab; // Reference to the projectile prefab to be spawned
public Transform triangleRotation;
public float spawnInterval = 1.0f; // Time interval between spawning projectiles
public float pointsToSpawnProjectiles = 4;

private float lastSpawnTime = 0.0f;
private GameObject currentProjectile;
Expand All @@ -32,7 +33,7 @@ private void Start()
void Update()
{
if (Time.time - lastSpawnTime >= spawnInterval &&
triangleCollision.hasCollided == true && enemySpawner.currentEnemyCount >= 4 &&
triangleCollision.hasCollided == true && enemySpawner.currentEnemyCount >= pointsToSpawnProjectiles &&
lightCalculator.won == false)
{
// Spawn a projectile at the position of the spawner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ MonoBehaviour:
- {fileID: 3621955379953864799}
_projectConfigurations:
configSet:
_Buckets: ffffffffffffffff060000000e000000ffffffff0a000000ffffffffffffffffffffffffffffffff080000000d000000020000000f000000090000000b0000000c000000
_HashCodes: 0bd5b82c8b5eac510d6e7c149302dd446ba49d65564b5e059e0c1f16d118b30a81f6ab4cade21018c1f8ab7ce1e51246d9e28149e246381099bbd054110fe44c00000000
_Buckets: ffffffffffffffff060000000e000000ffffffff0a000000ffffffffffffffff0c000000ffffffff080000000d000000020000000f000000090000000b000000ffffffff
_HashCodes: 0bd5b82c8b5eac510d6e7c149302dd446ba49d65564b5e059e0c1f16d118b30a81f6ab4cade21018c1f8ab7ce1e5124654b85919e246381099bbd054110fe44c00000000
_Next: ffffffff00000000ffffffffffffffffffffffffffffffff04000000ffffffff010000000700000005000000ffffffffffffffffffffffffffffffff0300000000000000
_Count: 16
_Version: 16
Expand All @@ -76,7 +76,7 @@ MonoBehaviour:
- light-game/macOS/macOS (Intelx64,App)
- light-game/macOS
- light-game/Android/Android (ARMv7+ARM64+X86+X86_64,Generic,App,APK,Single
Binary,Auto,Auto,Disabled)/IL2CPP
Binary,Auto,Auto,Disabled)/Mono
- light-game/Android/Android (ARMv7+ARM64+X86+X86_64,Generic,App,APK,Single
Binary,Auto,Auto,Disabled)
- light-game/Android
Expand Down Expand Up @@ -120,7 +120,7 @@ MonoBehaviour:
- enabled: 1
childKeys:
- light-game/Android/Android (ARMv7+ARM64+X86+X86_64,Generic,App,APK,Single
Binary,Auto,Auto,Disabled)/IL2CPP
Binary,Auto,Auto,Disabled)/Mono
- enabled: 1
childKeys:
- light-game/Android/Android (ARMv7+ARM64+X86+X86_64,Generic,App,APK,Single
Expand Down Expand Up @@ -395,10 +395,10 @@ MonoBehaviour:
scriptingBackends:
- scriptingImplementation: 0
name: Mono
enabled: 0
enabled: 1
- scriptingImplementation: 1
name: IL2CPP
enabled: 1
enabled: 0
platformName: Android
dataDirNameFormat: '{0}_Data'
targetGroup: 7
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ PlayerSettings:
vulkanEnableLateAcquireNextImage: 0
vulkanEnableCommandBufferRecycling: 1
loadStoreDebugModeEnabled: 0
bundleVersion: beta-7.0
bundleVersion: beta-7.1
preloadedAssets: []
metroInputSource: 0
wsaTransparentSwapchain: 0
Expand Down Expand Up @@ -715,7 +715,7 @@ PlayerSettings:
additionalCompilerArguments: {}
platformArchitecture: {}
scriptingBackend:
Android: 1
Android: 0
Standalone: 0
WebGL: 1
il2cppCompilerConfiguration: {}
Expand Down
Loading

0 comments on commit 996c4fb

Please sign in to comment.