Meeting updates

This commit is contained in:
RochesterX
2025-03-17 19:59:41 -04:00
parent 8a510c32d5
commit a3e2c9c6e2
8 changed files with 1676 additions and 1667 deletions

14
Assets/HatRespawn.cs Normal file
View File

@@ -0,0 +1,14 @@
using UnityEngine;
public class HatRespawn : MonoBehaviour
{
void OnTriggerEnter2D(Collider2D collision)
{
if (collision.gameObject.CompareTag("Platformer Hazard"))
{
transform.position = GameManager.Instance.hatSpawnPosition;
GetComponent<Rigidbody2D>().linearVelocity = Vector2.zero;
transform.rotation = Quaternion.identity;
}
}
}

View File

@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: 1803a208ca94f44a189bf03342859d36

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: e3c570bb90d434e809aca2a339dadf5d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -184,6 +184,7 @@ GameObject:
m_Component:
- component: {fileID: 210773657359985456}
- component: {fileID: 7422290698914274434}
- component: {fileID: 8903748158046000670}
m_Layer: 7
m_Name: Healthbar
m_TagString: Untagged
@@ -231,7 +232,20 @@ MonoBehaviour:
deathVisual: {fileID: 210773656378718008}
smoothSpeed: 0.05
text: {fileID: 210773657480500664}
player: {fileID: 0}
player: {fileID: 1375850422501237868, guid: 1fd31b88e5609482ab7e8ab16a932947, type: 3}
--- !u!114 &8903748158046000670
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 210773657359985459}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a80b536f823e50142b142b4e0b64ea97, type: 3}
m_Name:
m_EditorClassIdentifier:
healthBarPrefab: {fileID: 210773657359985459}
--- !u!1 &210773657480500666
GameObject:
m_ObjectHideFlags: 0

File diff suppressed because it is too large Load Diff

View File

@@ -45,10 +45,10 @@ public class GameManager : MonoBehaviour
print("Starting game with mode: " + gameMode + " and map: " + map);
if (gameMode == GameMode.freeForAll)
{
currentLives = maxLives;
foreach (GameObject player in players)
{
player.transform.position = spawnPosition + (players.IndexOf(player) * Vector2.right * offset);
player.GetComponent<Damageable>().lives = 5;
}
}
if (gameMode == GameMode.keepAway)
@@ -57,6 +57,7 @@ public class GameManager : MonoBehaviour
foreach (GameObject player in players)
{
player.transform.position = spawnPosition;
player.GetComponent<Damageable>().lives = 0;
}
}
if (gameMode == GameMode.obstacleCourse)
@@ -79,6 +80,7 @@ public class GameManager : MonoBehaviour
public static GameMode gameMode = GameMode.freeForAll; // loads a default gamemode as a safety net
public static string map = "Platformer With Headroom"; // loads a default map as a safety net
public Vector2 spawnPosition;
public Vector2 hatSpawnPosition;
public void PlayerDied(Damageable player)
{
@@ -100,7 +102,7 @@ public class GameManager : MonoBehaviour
}
if (gameMode == GameMode.keepAway)
{
RespawnPlayer(player.gameObject);
}
if (gameMode == GameMode.obstacleCourse)
{

View File

@@ -37,6 +37,7 @@ public class UseItem : MonoBehaviour
{
heldItem.GetComponent<Collider2D>().enabled = true;
heldItem.GetComponent<Rigidbody2D>().bodyType = RigidbodyType2D.Dynamic;
heldItem.transform.position += Vector3.up * 3f;
heldItem = null;
isHoldingItem = false;
}