From 2dad7631dddb958d70e9b166a085130439d2e12f Mon Sep 17 00:00:00 2001 From: Isaac Shoebottom Date: Thu, 16 Feb 2023 19:07:21 -0400 Subject: [PATCH] Add pathing for enemies --- .../.idea/indexLayout.xml | 14 +- Assets/Prefabs/Generation.prefab | 32 ++- Assets/Prefabs/PathNode.prefab | 64 ++++- Assets/Scenes/SampleScene.unity | 257 +++++++++++++---- Assets/Scripts/ArtistController.cs | 16 +- Assets/Scripts/GameController.cs | 21 -- Assets/Scripts/GenerationController.cs | 67 ++--- Assets/Scripts/LevelController.cs | 31 ++ ...roller.cs.meta => LevelController.cs.meta} | 2 +- Assets/Scripts/PathingController.cs | 44 --- Assets/Scripts/WaypointController.cs | 8 + ...ler.cs.meta => WaypointController.cs.meta} | 2 +- Assets/Textures/MapBackground.png | Bin 356 -> 0 bytes Assets/Textures/MapBackground.png.meta | 134 --------- .../{MapBackground.psd => MapBackground.psb} | Bin 26124 -> 28288 bytes Assets/Textures/MapBackground.psb.meta | 268 ++++++++++++++++++ Assets/Textures/MapBackground.psd.meta | 98 ------- Steps.md | 39 +++ 18 files changed, 673 insertions(+), 424 deletions(-) delete mode 100644 Assets/Scripts/GameController.cs create mode 100644 Assets/Scripts/LevelController.cs rename Assets/Scripts/{GameController.cs.meta => LevelController.cs.meta} (83%) delete mode 100644 Assets/Scripts/PathingController.cs create mode 100644 Assets/Scripts/WaypointController.cs rename Assets/Scripts/{PathingController.cs.meta => WaypointController.cs.meta} (83%) delete mode 100644 Assets/Textures/MapBackground.png delete mode 100644 Assets/Textures/MapBackground.png.meta rename Assets/Textures/{MapBackground.psd => MapBackground.psb} (74%) create mode 100644 Assets/Textures/MapBackground.psb.meta delete mode 100644 Assets/Textures/MapBackground.psd.meta create mode 100644 Steps.md diff --git a/.idea/.idea.MAAC3601-TD-Game/.idea/indexLayout.xml b/.idea/.idea.MAAC3601-TD-Game/.idea/indexLayout.xml index 7b08163..f5a863a 100644 --- a/.idea/.idea.MAAC3601-TD-Game/.idea/indexLayout.xml +++ b/.idea/.idea.MAAC3601-TD-Game/.idea/indexLayout.xml @@ -1,8 +1,8 @@ - - - - - - - + + + + + + + \ No newline at end of file diff --git a/Assets/Prefabs/Generation.prefab b/Assets/Prefabs/Generation.prefab index f73dc36..c6e1a3e 100644 --- a/Assets/Prefabs/Generation.prefab +++ b/Assets/Prefabs/Generation.prefab @@ -12,6 +12,7 @@ GameObject: - component: {fileID: 2981135554967256007} - component: {fileID: 1540579659150390887} - component: {fileID: 7146678828090736945} + - component: {fileID: 2294062540900002317} m_Layer: 0 m_Name: Generation m_TagString: Untagged @@ -98,7 +99,6 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 6d151e6102b72db4590ce83309573f1c, type: 3} m_Name: m_EditorClassIdentifier: - PathGameObject: {fileID: 0} --- !u!50 &7146678828090736945 Rigidbody2D: serializedVersion: 4 @@ -107,7 +107,7 @@ Rigidbody2D: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1458536803320539101} - m_BodyType: 0 + m_BodyType: 1 m_Simulated: 1 m_UseFullKinematicContacts: 0 m_UseAutoMass: 0 @@ -117,6 +117,32 @@ Rigidbody2D: m_GravityScale: 0 m_Material: {fileID: 0} m_Interpolate: 0 - m_SleepingMode: 1 + m_SleepingMode: 0 m_CollisionDetection: 0 m_Constraints: 0 +--- !u!61 &2294062540900002317 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1458536803320539101} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 diff --git a/Assets/Prefabs/PathNode.prefab b/Assets/Prefabs/PathNode.prefab index ca17c0b..0fe3bd6 100644 --- a/Assets/Prefabs/PathNode.prefab +++ b/Assets/Prefabs/PathNode.prefab @@ -10,7 +10,9 @@ GameObject: m_Component: - component: {fileID: 328858392699145925} - component: {fileID: 4841795318599809648} - - component: {fileID: 2671460795696364852} + - component: {fileID: 8192986790885562340} + - component: {fileID: -834716027335084487} + - component: {fileID: 8406881250321231346} m_Layer: 0 m_Name: PathNode m_TagString: Untagged @@ -27,7 +29,7 @@ Transform: m_GameObject: {fileID: 2624247600710686983} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: -0.7311517, y: 0.074633844, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 0.1, y: 0.1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} @@ -75,7 +77,7 @@ SpriteRenderer: m_SortingLayer: 0 m_SortingOrder: 0 m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3} - m_Color: {r: 0, g: 0, b: 0, a: 0} + m_Color: {r: 1, g: 0, b: 0, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 0 @@ -85,16 +87,62 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 ---- !u!65 &2671460795696364852 -BoxCollider: +--- !u!50 &8192986790885562340 +Rigidbody2D: + serializedVersion: 4 m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2624247600710686983} + m_BodyType: 2 + m_Simulated: 1 + m_UseFullKinematicContacts: 0 + m_UseAutoMass: 0 + m_Mass: 1 + m_LinearDrag: 0 + m_AngularDrag: 0.05 + m_GravityScale: 1 + m_Material: {fileID: 0} + m_Interpolate: 0 + m_SleepingMode: 1 + m_CollisionDetection: 0 + m_Constraints: 0 +--- !u!61 &-834716027335084487 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2624247600710686983} + m_Enabled: 1 + m_Density: 1 m_Material: {fileID: 0} m_IsTrigger: 1 - m_Enabled: 1 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 1, y: 1} + newSize: {x: 1, y: 1} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 serializedVersion: 2 - m_Size: {x: 1, y: 1, z: 0.2} - m_Center: {x: 0, y: 0, z: 0} + m_Size: {x: 1, y: 1} + m_EdgeRadius: 0 +--- !u!114 &8406881250321231346 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2624247600710686983} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2346c6ef8f7f55541b5f27987d960a46, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index 8122d53..ab1c83a 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -123,6 +123,130 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} +--- !u!1001 &287684445 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_RootOrder + value: 8 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.x + value: 11.76163 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.y + value: 2.9282274 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2624247600710686983, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_Name + value: Waypoint 3 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} +--- !u!1 &287684446 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2624247600710686983, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + m_PrefabInstance: {fileID: 287684445} + m_PrefabAsset: {fileID: 0} +--- !u!1001 &367263645 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_RootOrder + value: 7 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.x + value: -8.71 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.y + value: 3.33 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2624247600710686983, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_Name + value: Waypoint 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} +--- !u!1 &367263646 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2624247600710686983, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + m_PrefabInstance: {fileID: 367263645} + m_PrefabAsset: {fileID: 0} --- !u!1 &449794919 GameObject: m_ObjectHideFlags: 0 @@ -181,12 +305,12 @@ SpriteRenderer: m_SortingLayerID: -22961053 m_SortingLayer: -1 m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: a92d11379a5e674489668c40439d778d, type: 3} + m_Sprite: {fileID: 5854342148761561055, guid: 8cdb315d4968ef847a63e52bd8847e5b, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 m_DrawMode: 2 - m_Size: {x: 27.3, y: 14.3} + m_Size: {x: 22, y: 10.7} m_AdaptiveModeThreshold: 0.5 m_SpriteTileMode: 0 m_WasSpriteAssigned: 1 @@ -200,12 +324,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 449794919} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: -0.29, z: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 6 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &519420028 GameObject: @@ -446,7 +570,7 @@ GameObject: - component: {fileID: 1014711458} - component: {fileID: 1014711459} m_Layer: 0 - m_Name: Controller + m_Name: LevelController m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -460,12 +584,12 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1014711457} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 7.6740193, y: 7.8, z: -10.011237} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &1014711459 MonoBehaviour: @@ -476,56 +600,15 @@ MonoBehaviour: m_GameObject: {fileID: 1014711457} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 709edaf88476e014f9de790745097efd, type: 3} + m_Script: {fileID: 11500000, guid: 29744b92ef0fa824ba2c2dfaecd784ed, type: 3} m_Name: m_EditorClassIdentifier: artist: {fileID: 2276488776047960095, guid: e7ecd0892a155ad40b2253fe45b2f43a, type: 3} ---- !u!1 &1292283376 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1292283378} - - component: {fileID: 1292283377} - m_Layer: 0 - m_Name: Path - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!114 &1292283377 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1292283376} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 62f8cdc29b6f43e4998a2750b3b9a023, type: 3} - m_Name: - m_EditorClassIdentifier: - waypointPrefab: {fileID: 2624247600710686983, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} - enemyPrefab: {fileID: 1458536803320539101, guid: f1eab3cea41682c4ba2ff7c2b218fc0b, type: 3} ---- !u!4 &1292283378 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1292283376} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -10.78, y: 8.21, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 2 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + enemy: {fileID: 1458536803320539101, guid: f1eab3cea41682c4ba2ff7c2b218fc0b, type: 3} + waypoints: + - {fileID: 1556613419} + - {fileID: 367263646} + - {fileID: 287684446} --- !u!1 &1321858736 GameObject: m_ObjectHideFlags: 0 @@ -619,13 +702,75 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 4 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 0, y: 0} m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0, y: 0} +--- !u!1001 &1556613418 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_RootOrder + value: 6 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.x + value: -8.61 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.y + value: -6.2 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalPosition.z + value: -0.0487628 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.x + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.y + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalRotation.z + value: -0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 328858392699145925, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2624247600710686983, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + propertyPath: m_Name + value: Waypoint 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} +--- !u!1 &1556613419 stripped +GameObject: + m_CorrespondingSourceObject: {fileID: 2624247600710686983, guid: fad75b8b6a5d5a6468eef0f0782ea835, type: 3} + m_PrefabInstance: {fileID: 1556613418} + m_PrefabAsset: {fileID: 0} --- !u!1 &1644448702 GameObject: m_ObjectHideFlags: 0 @@ -691,5 +836,5 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 5 + m_RootOrder: 4 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} diff --git a/Assets/Scripts/ArtistController.cs b/Assets/Scripts/ArtistController.cs index a20cd6c..42d9354 100644 --- a/Assets/Scripts/ArtistController.cs +++ b/Assets/Scripts/ArtistController.cs @@ -1,17 +1,5 @@ -using System.Collections; -using System.Collections.Generic; -using Unity.VisualScripting; using UnityEngine; public class ArtistController : MonoBehaviour { - // Start is called before the first frame update - void Start() - { - - } - - // Update is called once per frame - void Update() - { - } -} + +} \ No newline at end of file diff --git a/Assets/Scripts/GameController.cs b/Assets/Scripts/GameController.cs deleted file mode 100644 index d1b67b3..0000000 --- a/Assets/Scripts/GameController.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class GameController : MonoBehaviour -{ - public GameObject artist; - // Start is called before the first frame update - void Start() - { - - } - - // Update is called once per frame - void Update() - { - if (Input.GetMouseButtonDown(0)) { - Instantiate(artist, Camera.main.ScreenToWorldPoint(Input.mousePosition) + Vector3.forward, Quaternion.identity); - } - } -} diff --git a/Assets/Scripts/GenerationController.cs b/Assets/Scripts/GenerationController.cs index d1929aa..712b346 100644 --- a/Assets/Scripts/GenerationController.cs +++ b/Assets/Scripts/GenerationController.cs @@ -4,44 +4,37 @@ using System.Collections.Generic; using UnityEngine; public class GenerationController : MonoBehaviour { + internal GameObject[] waypoints; + private int waypointIndex = 1; + + private Rigidbody2D rb; - public GameObject PathGameObject; - private Rigidbody2D rb; + // Start is called before the first frame update + private void Start() { + rb = GetComponent(); + } - int pathIndex = 0; + // Update is called once per frame + void Update() { } - bool moving = false; + private void FixedUpdate() { + if (waypointIndex < waypoints.Length) { + var target = waypoints[waypointIndex].transform.position; + var direction = target - transform.position; + var f = transform.position + direction.normalized * 0.1f; + rb.MovePosition(f); + } else if (waypointIndex >= waypoints.Length) { + Destroy(gameObject); + } + } - private GameObject pathPointer; - - // Start is called before the first frame update - void Start() - { - rb = GetComponent(); - PathGameObject = GameObject.Find("Path"); - } - - // Update is called once per frame - void Update() - { - - } - - private void FixedUpdate() { - pathPointer = PathGameObject.GetComponent().waypointList[pathIndex] as GameObject; - - if (!moving) { - Vector2 force = new Vector2(pathPointer.transform.position.x, pathPointer.transform.position.y); - rb.AddForce(force); - moving = true; - } - - } - - private void OnTriggerEnter2D(Collider2D col) { - if (col.gameObject == pathPointer) { - moving = false; - pathIndex++; - } - } -} + private void OnTriggerEnter2D(Collider2D col) { + if (col.gameObject == waypoints[waypointIndex]) { + waypointIndex++; + } + } + + public void setWaypoints(GameObject[] waypointsIn) { + waypoints = waypointsIn; + } +} \ No newline at end of file diff --git a/Assets/Scripts/LevelController.cs b/Assets/Scripts/LevelController.cs new file mode 100644 index 0000000..e5ac937 --- /dev/null +++ b/Assets/Scripts/LevelController.cs @@ -0,0 +1,31 @@ +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using UnityEngine; + +public class LevelController : MonoBehaviour { + public GameObject artist; + public GameObject enemy; + public GameObject[] waypoints; + + + private Queue enemies = new(); + // Start is called before the first frame update + void Start() { + spawnEnemy(enemy, waypoints[0].transform.position); + } + + // Update is called once per frame + void Update() { + if (Input.GetMouseButtonDown(0)) { + Instantiate(artist, Camera.main.ScreenToWorldPoint(Input.mousePosition) + Vector3.forward, Quaternion.identity); + } + } + + private void spawnEnemy(GameObject enemyIn, Vector3 position) { + var e = Instantiate(enemyIn, position, Quaternion.identity); + var ec = e.GetComponent(); + ec.setWaypoints(waypoints); + enemies.Enqueue(e); + } +} \ No newline at end of file diff --git a/Assets/Scripts/GameController.cs.meta b/Assets/Scripts/LevelController.cs.meta similarity index 83% rename from Assets/Scripts/GameController.cs.meta rename to Assets/Scripts/LevelController.cs.meta index 2623882..aa9128f 100644 --- a/Assets/Scripts/GameController.cs.meta +++ b/Assets/Scripts/LevelController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 709edaf88476e014f9de790745097efd +guid: 29744b92ef0fa824ba2c2dfaecd784ed MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/PathingController.cs b/Assets/Scripts/PathingController.cs deleted file mode 100644 index f06f649..0000000 --- a/Assets/Scripts/PathingController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class PathingController : MonoBehaviour { - - public GameObject waypointPrefab; - public ArrayList waypointList = new ArrayList(); - - public GameObject enemyPrefab; - - private ArrayList enemyList = new ArrayList(); - - int counter = 0; - - // Start is called before the first frame update - void Start() - { - waypointList.Add(Instantiate(waypointPrefab, new Vector3(0, 0, 0), Quaternion.identity)); - waypointList.Add(Instantiate(waypointPrefab, new Vector3(0, 5, 0), Quaternion.identity)); - waypointList.Add(Instantiate(waypointPrefab, new Vector3(5, 5, 0), Quaternion.identity)); - - } - - // Update is called once per frame - void Update() - { - - } - - private void FixedUpdate() { - if (counter == 0) { - enemyList.Add(Instantiate(enemyPrefab)); - counter++; - } - else if (counter >= 50) { - counter = 0; - } - else { - counter++; - } - } -} diff --git a/Assets/Scripts/WaypointController.cs b/Assets/Scripts/WaypointController.cs new file mode 100644 index 0000000..7103b4d --- /dev/null +++ b/Assets/Scripts/WaypointController.cs @@ -0,0 +1,8 @@ +using UnityEngine; + +public class WaypointController : MonoBehaviour { + private void Start() { + var transparent = new Color(1, 1, 1, 0); + GetComponent().color = transparent; + } +} \ No newline at end of file diff --git a/Assets/Scripts/PathingController.cs.meta b/Assets/Scripts/WaypointController.cs.meta similarity index 83% rename from Assets/Scripts/PathingController.cs.meta rename to Assets/Scripts/WaypointController.cs.meta index 58e295a..32d54b4 100644 --- a/Assets/Scripts/PathingController.cs.meta +++ b/Assets/Scripts/WaypointController.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 62f8cdc29b6f43e4998a2750b3b9a023 +guid: 2346c6ef8f7f55541b5f27987d960a46 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Textures/MapBackground.png b/Assets/Textures/MapBackground.png deleted file mode 100644 index d34bc7ca90c388764d26481a0c70c3e6c829552a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 356 zcmeAS@N?(olHy`uVBq!ia0vp^3xGI^gAGX9ABzPEa29w(7Bet#3xhBt!>lew&0YQ8<@ejm u4`?z@5>gl*#ILo#SD1fDvP1Qb6@%z^rhZm2wsXK>WAJqKb6Mw<&;$Ui_*78< diff --git a/Assets/Textures/MapBackground.png.meta b/Assets/Textures/MapBackground.png.meta deleted file mode 100644 index 80d703e..0000000 --- a/Assets/Textures/MapBackground.png.meta +++ /dev/null @@ -1,134 +0,0 @@ -fileFormatVersion: 2 -guid: a92d11379a5e674489668c40439d778d -TextureImporter: - internalIDToNameTable: [] - externalObjects: {} - serializedVersion: 11 - mipmaps: - mipMapMode: 0 - enableMipMap: 0 - sRGBTexture: 1 - linearTexture: 0 - fadeOut: 0 - borderMipMap: 0 - mipMapsPreserveCoverage: 0 - alphaTestReferenceValue: 0.5 - mipMapFadeDistanceStart: 1 - mipMapFadeDistanceEnd: 3 - bumpmap: - convertToNormalMap: 0 - externalNormalMap: 0 - heightScale: 0.25 - normalMapFilter: 0 - isReadable: 0 - streamingMipmaps: 0 - streamingMipmapsPriority: 0 - vTOnly: 0 - ignoreMasterTextureLimit: 0 - grayScaleToAlpha: 0 - generateCubemap: 6 - cubemapConvolution: 0 - seamlessCubemap: 0 - textureFormat: 1 - maxTextureSize: 2048 - textureSettings: - serializedVersion: 2 - filterMode: 0 - aniso: 1 - mipBias: 0 - wrapU: 0 - wrapV: 0 - wrapW: 0 - nPOTScale: 0 - lightmap: 0 - compressionQuality: 50 - spriteMode: 1 - spriteExtrude: 1 - spriteMeshType: 0 - alignment: 0 - spritePivot: {x: 0.5, y: 0.5} - spritePixelsToUnits: 100 - spriteBorder: {x: 0, y: 0, z: 0, w: 0} - spriteGenerateFallbackPhysicsShape: 1 - alphaUsage: 1 - alphaIsTransparency: 1 - spriteTessellationDetail: -1 - textureType: 8 - textureShape: 1 - singleChannelComponent: 0 - flipbookRows: 1 - flipbookColumns: 1 - maxTextureSizeSet: 0 - compressionQualitySet: 0 - textureFormatSet: 0 - ignorePngGamma: 0 - applyGammaDecoding: 0 - platformSettings: - - serializedVersion: 3 - buildTarget: DefaultTexturePlatform - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Standalone - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: Server - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - - serializedVersion: 3 - buildTarget: WebGL - maxTextureSize: 2048 - resizeAlgorithm: 0 - textureFormat: -1 - textureCompression: 1 - compressionQuality: 50 - crunchedCompression: 0 - allowsAlphaSplitting: 0 - overridden: 0 - androidETC2FallbackOverride: 0 - forceMaximumCompressionQuality_BC6H_BC7: 0 - spriteSheet: - serializedVersion: 2 - sprites: [] - outline: [] - physicsShape: [] - bones: [] - spriteID: 5e97eb03825dee720800000000000000 - internalID: 0 - vertices: [] - indices: - edges: [] - weights: [] - secondaryTextures: [] - nameFileIdTable: {} - spritePackingTag: - pSDRemoveMatte: 0 - pSDShowRemoveMatteOption: 0 - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Textures/MapBackground.psd b/Assets/Textures/MapBackground.psb similarity index 74% rename from Assets/Textures/MapBackground.psd rename to Assets/Textures/MapBackground.psb index 9f7eaf3897943497372d986036c6cbb2cb87b8f9..5f414bde22a0bf68fa84dc892d582cfc9470a9da 100644 GIT binary patch literal 28288 zcmeHQX>c6H74F&9eOkUSN5Qg|upwFPq1Cm~Ve7E9;I)M$+u*9iH9IrAT5EP@nVHq$ zDh@#s7ghNYD`1lRNJN0dMGB~pkW?xa?u1Y&ir7Ga92G<$7e@>RM7TDuduDnMN%mB1 zIk=eF>Y3N?y?*`r>(@O!tLar+&)_g}ApLN{We=oTRE97O$H4x!o^Yh7h-7LnVD=#A z`3+kyfD*V6ku?z6il?6b;M&7aJXl_w8o&3x;>WfVSv{7u-_y}OnPRyyL32fgctYxQ z|N9pYxm^jq)4jVn;)|quh0(;oenlAGzkP(;KgPB5?(VLNj>*tuGL;lG)-{1KI3DujT>Y_HozRJ5^9_hu|`T@@L0^~#FiYH##;IG@kwYHe@yxB9t2YwYu`fG-g6 z`r5qy7LUIztM>Q=K@_HvGCK@N28f7K!^|!aT zdwl_KAm9NFk2)o3?4(Ch*Xu@1JAH!6DT$PpkR=zk%SPq2*6DWRis)f9ESaJeNopf$ zWFsdhy_0Op>u>aV7c0bbv`i|kh{QFX^9rJn6eLZBa{fij0j7}%ExKrR$>gFXRjq#< zT3{fuXi0TsDkXS_1XWHeoX|fGo~&QY`P8Va$?B-QM7yb2Z$0T89kUK_Kh&!TtR^cX zvMhG#9Y1K=a|MEpKG(+G35k~{)Jr?Oh5A|ev!;YTRuj4)J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