Slimes can now cross tile boundaries.

This commit is contained in:
finnchen123
2026-02-08 20:31:04 +01:00
parent 53f775dfe7
commit f98c32d558
4 changed files with 19 additions and 15 deletions

View File

@@ -68,13 +68,17 @@ namespace Assets.Scripts.InteractableObjects
{
if (col.name.Contains("_") && col.gameObject == gameObject.transform.parent.gameObject)
{
gameObject.GetComponent<Rigidbody>().AddForce(gameObject.GetComponent<Rigidbody>().linearVelocity * -2, ForceMode.Impulse);
col.gameObject.GetComponent<Tile>().aliveEnemies.Remove(gameObject);
}
}
public void HandleAttack()
void OnTriggerEnter(Collider col)
{
//TODO: Force Fight start
if (col.name.Contains("_") && col.gameObject != gameObject.transform.parent.gameObject)
{
col.gameObject.GetComponent<Tile>().aliveEnemies.Add(gameObject);
gameObject.transform.SetParent(col.gameObject.transform);
}
}
public void handleFollow(bool isFollowing)

View File

@@ -13,7 +13,7 @@ public class Tile : MonoBehaviour
System.Random rand = new System.Random();
TileType tiletype;
GameObject contentGenerator;
List<GameObject> aliveEnemies = new List<GameObject>();
public List<GameObject> aliveEnemies = new List<GameObject>();
public void generateTile(Vector3 pos, TileType type)
{

View File

@@ -106,7 +106,7 @@ v2.0.0 - Gameplay and UI improvements (last update)
- Improved enemy generation
- Worked on controls and camera (Still a bit unpolished but close to finished)
v2.1.0 - Gameplay and UI improvements (current version)
v2.1.0 - Fixing some flaws (current version)
-----Visuals/Sounds-----
- Added background to coordinates // @Lunchen
- Increased font size on some elements // @Lunchen

View File

@@ -118,7 +118,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 100}
m_MaxSize: {x: 24288, y: 16192}
vertical: 1
controlID: 65
controlID: 104
draggingID: 0
--- !u!114 &6
MonoBehaviour:
@@ -144,7 +144,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 100}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 66
controlID: 105
draggingID: 0
--- !u!114 &7
MonoBehaviour:
@@ -170,7 +170,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 67
controlID: 20
draggingID: 0
--- !u!114 &8
MonoBehaviour:
@@ -196,7 +196,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 50}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 42
controlID: 21
draggingID: 0
--- !u!114 &9
MonoBehaviour:
@@ -984,7 +984,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: a68bffff12fbffff
m_ExpandedIDs: 9268ffff
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -1176,9 +1176,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 116}
m_SelectedIDs: 6eb70000
m_LastClickedID: 46958
m_ExpandedIDs: 00000000b0bb0000b2bb0000b4bb0000b6bb0000b8bb0000babb0000
m_SelectedIDs: 14bc0000
m_LastClickedID: 48148
m_ExpandedIDs: 000000007c9a00007e9a0000809a0000829a0000849a0000869a0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -1207,7 +1207,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000b0bb0000b2bb0000b4bb0000b6bb0000b8bb0000babb0000
m_ExpandedIDs: 000000007c9a00007e9a0000809a0000829a0000849a0000869a0000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name: