Compare commits

..

32 commits

Author SHA1 Message Date
6ba1ed7d78
Update README.md 2021-04-30 11:58:53 +03:00
b2c59f5386 Implement Gameover handling on player death 2019-09-07 12:31:07 +03:00
a9023a7efd Make player die when in contact wiht enemy 2019-09-07 12:17:37 +03:00
5e6c27b672 Clean GameManager & UpgradeBase variable names 2019-08-31 11:49:41 +03:00
649a0f7b59 Rename Sprites/Ammo to Sprites/Items 2019-08-31 11:47:15 +03:00
362435fc70 Fix DestrictibleWall variable names 2019-08-31 11:45:22 +03:00
641a8bc46d Change ExitDoor sprite 2019-08-31 11:43:29 +03:00
14c7fd7607
Merge pull request #85 from dnutiu/bombutil-refactor
Bombutil refactor
2019-08-26 21:43:26 +03:00
e56982568b Improve exitDoor script 2019-08-26 21:41:58 +03:00
369a86c9d8 Refactor BombUtil and couple with player 2019-08-26 21:36:26 +03:00
01bddcc821
Merge pull request #84 from dnutiu/player-input-handler
Player input handler
2019-08-25 23:05:56 +03:00
9f3423890c Create a Sprite sub-gameobject for each upgrade 2019-08-25 22:42:25 +03:00
712965e5ad Couple PlayerUpgrade with Player 2019-08-25 22:38:20 +03:00
52a7a536c8 Cleanup BombUtilManager 2019-08-24 19:27:32 +03:00
22af655678 Renamed Ammo to Bomb 2019-08-24 19:23:36 +03:00
13ab2ddb9c Renamed Resources/Ammo to Resources/Items and Explosion to BombExplosion 2019-08-24 19:19:44 +03:00
d6ffb9b095 Refactored Player and deleted BombSpawner 2019-08-24 19:11:14 +03:00
2aa1e9c054 Delete Animations/Misc folder 2019-08-24 14:42:33 +03:00
38daff83ef
Merge pull request #80 from dnutiu/singletons-refactor
Singletons refactor
2019-08-24 13:25:21 +03:00
9b10e457e4 LevelManager cleanup 2019-08-24 00:38:20 +03:00
e4a0b9838c Remove Enemy/Dummy folder 2019-08-24 00:35:37 +03:00
ef98d2e2f3 Remove unused Misc animations 2019-08-24 00:33:26 +03:00
c8059dcf24 Turn all Singletons into GameObjects 2019-08-24 00:29:38 +03:00
22830ee4be Implement player death and godmode 2019-08-22 20:39:20 +03:00
5d8fb3fbc9 Add animation for enemy death 2019-08-22 20:05:58 +03:00
7395be7496
Merge pull request #71 from dnutiu/enemy-death-animation
Implement enemy death animation
2019-08-22 19:10:17 +03:00
18e95b16b6 Implement enemy death animation 2019-08-21 19:23:28 +03:00
c972ce5514
Create README.md 2019-08-17 12:28:37 +03:00
d2d3f4f7a5
Merge pull request #69 from dnutiu/upgrades-upgrade
Added sprites for the upgrades
2019-08-17 12:27:07 +03:00
9e4d029f86 Update packages file 2019-08-17 12:07:31 +03:00
21fe05bdee Add new upgrade GoldenBomb: +1 bomb & +1 flame 2019-08-17 11:45:15 +03:00
826e714797 Changing upgrade sprites 2019-08-17 11:37:32 +03:00
91 changed files with 1421 additions and 1108 deletions

View file

@ -69,7 +69,7 @@ AnimationClip:
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopTime: 0
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0

View file

@ -8,7 +8,13 @@ AnimatorController:
m_PrefabAsset: {fileID: 0}
m_Name: SnowEnemy
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorParameters:
- m_Name: animExplode
m_Type: 9
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -22,6 +28,31 @@ AnimatorController:
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1101 &1101050033753575424
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: animExplode
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102904380652978156}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0.25
m_TransitionOffset: 0
m_ExitTime: 0.25
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1102 &1102746068587636566
AnimatorState:
serializedVersion: 5
@ -29,7 +60,34 @@ AnimatorState:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Dumber
m_Name: Normal
m_Speed: 1
m_CycleOffset: 0
m_Transitions:
- {fileID: 1101050033753575424}
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: d32d6d8d922234eafb6c5669dc7a1cc6, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &1102904380652978156
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Exploding
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
@ -42,7 +100,7 @@ AnimatorState:
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: d32d6d8d922234eafb6c5669dc7a1cc6, type: 2}
m_Motion: {fileID: 7400000, guid: 64702b3fca0bfc246824242792c7d291, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
@ -59,14 +117,17 @@ AnimatorStateMachine:
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102746068587636566}
m_Position: {x: 200, y: 0, z: 0}
m_Position: {x: 336, y: 24, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102904380652978156}
m_Position: {x: 264, y: -108, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_EntryPosition: {x: 120, y: 156, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102746068587636566}

View file

@ -1,53 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: New Animation
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves: []
m_SampleRate: 60
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings: []
pptrCurveMapping: []
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 1
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 79ce70887698d1346967cbaf607d171d
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,77 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!74 &7400000
AnimationClip:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pulverise
serializedVersion: 6
m_Legacy: 0
m_Compressed: 0
m_UseHighQualityCurve: 1
m_RotationCurves: []
m_CompressedRotationCurves: []
m_EulerCurves: []
m_PositionCurves: []
m_ScaleCurves: []
m_FloatCurves: []
m_PPtrCurves:
- curve:
- time: 0
value: {fileID: 21300052, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
- time: 0.06666667
value: {fileID: 21300054, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
- time: 0.13333334
value: {fileID: 21300056, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
- time: 0.2
value: {fileID: 21300058, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
attribute: m_Sprite
path:
classID: 212
script: {fileID: 0}
m_SampleRate: 15
m_WrapMode: 0
m_Bounds:
m_Center: {x: 0, y: 0, z: 0}
m_Extent: {x: 0, y: 0, z: 0}
m_ClipBindingConstant:
genericBindings:
- serializedVersion: 2
path: 0
attribute: 0
script: {fileID: 0}
typeID: 212
customType: 23
isPPtrCurve: 1
pptrCurveMapping:
- {fileID: 21300052, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
- {fileID: 21300054, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
- {fileID: 21300056, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
- {fileID: 21300058, guid: 1611b607563ac5b4d919348f10e92487, type: 3}
m_AnimationClipSettings:
serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0
m_StartTime: 0
m_StopTime: 0.26666668
m_OrientationOffsetY: 0
m_Level: 0
m_CycleOffset: 0
m_HasAdditiveReferencePose: 0
m_LoopTime: 1
m_LoopBlend: 0
m_LoopBlendOrientation: 0
m_LoopBlendPositionY: 0
m_LoopBlendPositionXZ: 0
m_KeepOriginalOrientation: 0
m_KeepOriginalPositionY: 1
m_KeepOriginalPositionXZ: 0
m_HeightFromFeet: 0
m_Mirror: 0
m_EditorCurves: []
m_EulerEditorCurves: []
m_HasGenericRootTransform: 0
m_HasMotionFloatCurves: 0
m_Events: []

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 536dece361312c14bac0cf30829bee84
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 7400000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,93 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pulverised
serializedVersion: 5
m_AnimatorParameters:
- m_Name: Blend
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107354719584562404}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!206 &206365093828297014
BlendTree:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Blend Tree
m_Childs: []
m_BlendParameter: Blend
m_BlendParameterY: Blend
m_MinThreshold: 0
m_MaxThreshold: 1
m_UseAutomaticThresholds: 1
m_NormalizedBlendValues: 0
m_BlendType: 0
--- !u!1102 &1102215421647958874
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pulverise
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 206365093828297014}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &1107354719584562404
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102215421647958874}
m_Position: {x: 264, y: 72, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 48, y: 24, z: 0}
m_EntryPosition: {x: 48, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102215421647958874}

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: f99f14e77d0442846ba579190dffc1c2
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,72 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!91 &9100000
AnimatorController:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: RespawnPosition
serializedVersion: 5
m_AnimatorParameters: []
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
m_StateMachine: {fileID: 1107214311928363052}
m_Mask: {fileID: 0}
m_Motions: []
m_Behaviours: []
m_BlendingMode: 0
m_SyncedLayerIndex: -1
m_DefaultWeight: 0
m_IKPass: 0
m_SyncedLayerAffectsTiming: 0
m_Controller: {fileID: 9100000}
--- !u!1102 &1102082738737299528
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Pulverise
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 536dece361312c14bac0cf30829bee84, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1107 &1107214311928363052
AnimatorStateMachine:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Base Layer
m_ChildStates:
- serializedVersion: 1
m_State: {fileID: 1102082738737299528}
m_Position: {x: 200, y: 0, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions: []
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []
m_AnyStatePosition: {x: 50, y: 20, z: 0}
m_EntryPosition: {x: 50, y: 120, z: 0}
m_ExitPosition: {x: 800, y: 120, z: 0}
m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
m_DefaultState: {fileID: 1102082738737299528}

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 621169a4828cad04ba17bb6ddfae4979
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 9100000
userData:
assetBundleName:
assetBundleVariant:

View file

@ -14,13 +14,19 @@ AnimatorController:
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: AnimHorizontal
m_Type: 1
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 9100000}
m_Controller: {fileID: 0}
- m_Name: AnimDeath
m_Type: 4
m_DefaultFloat: 0
m_DefaultInt: 0
m_DefaultBool: 0
m_Controller: {fileID: 0}
m_AnimatorLayers:
- serializedVersion: 5
m_Name: Base Layer
@ -70,6 +76,9 @@ AnimatorStateTransition:
- m_ConditionMode: 4
m_ConditionEvent: AnimHorizontal
m_EventTreshold: -0.5
- m_ConditionMode: 2
m_ConditionEvent: AnimDeath
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102748770843519456}
m_Solo: 0
@ -95,6 +104,9 @@ AnimatorStateTransition:
- m_ConditionMode: 4
m_ConditionEvent: AnimVertical
m_EventTreshold: -0.5
- m_ConditionMode: 2
m_ConditionEvent: AnimDeath
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102120525955278410}
m_Solo: 0
@ -120,6 +132,9 @@ AnimatorStateTransition:
- m_ConditionMode: 3
m_ConditionEvent: AnimVertical
m_EventTreshold: 0.5
- m_ConditionMode: 2
m_ConditionEvent: AnimDeath
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102707571100786070}
m_Solo: 0
@ -195,6 +210,9 @@ AnimatorStateTransition:
- m_ConditionMode: 3
m_ConditionEvent: AnimHorizontal
m_EventTreshold: 0.5
- m_ConditionMode: 2
m_ConditionEvent: AnimDeath
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102659054847133602}
m_Solo: 0
@ -234,6 +252,31 @@ AnimatorStateTransition:
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 1
--- !u!1101 &1101700441446661162
AnimatorStateTransition:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name:
m_Conditions:
- m_ConditionMode: 1
m_ConditionEvent: AnimDeath
m_EventTreshold: 0
m_DstStateMachine: {fileID: 0}
m_DstState: {fileID: 1102642923892936116}
m_Solo: 0
m_Mute: 0
m_IsExit: 0
serializedVersion: 3
m_TransitionDuration: 0
m_TransitionOffset: 0
m_ExitTime: 0.75
m_HasExitTime: 0
m_HasFixedDuration: 0
m_InterruptionSource: 0
m_OrderedInterruption: 1
m_CanTransitionToSelf: 0
--- !u!1102 &1102120525955278410
AnimatorState:
serializedVersion: 5
@ -287,6 +330,32 @@ AnimatorState:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &1102642923892936116
AnimatorState:
serializedVersion: 5
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Dead
m_Speed: 1
m_CycleOffset: 0
m_Transitions: []
m_StateMachineBehaviours: []
m_Position: {x: 50, y: 50, z: 0}
m_IKOnFeet: 0
m_WriteDefaultValues: 1
m_Mirror: 0
m_SpeedParameterActive: 0
m_MirrorParameterActive: 0
m_CycleOffsetParameterActive: 0
m_TimeParameterActive: 0
m_Motion: {fileID: 7400000, guid: 64702b3fca0bfc246824242792c7d291, type: 2}
m_Tag:
m_SpeedParameter:
m_MirrorParameter:
m_CycleOffsetParameter:
m_TimeParameter:
--- !u!1102 &1102659054847133602
AnimatorState:
serializedVersion: 5
@ -479,12 +548,16 @@ AnimatorStateMachine:
- serializedVersion: 1
m_State: {fileID: 1102847672094439108}
m_Position: {x: 468, y: -72, z: 0}
- serializedVersion: 1
m_State: {fileID: 1102642923892936116}
m_Position: {x: 36, y: -192, z: 0}
m_ChildStateMachines: []
m_AnyStateTransitions:
- {fileID: 1101257656438077058}
- {fileID: 1101676765764997760}
- {fileID: 1101374072583212264}
- {fileID: 1101296880187612534}
- {fileID: 1101700441446661162}
m_EntryTransitions: []
m_StateMachineTransitions: {}
m_StateMachineBehaviours: []

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: bf3e6294c377ca84d82651fe870a56dc
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,47 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1896072655702505677
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1896072655702505676}
- component: {fileID: 5279176810039195611}
m_Layer: 0
m_Name: BombSpawner
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1896072655702505676
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1896072655702505677}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 7.8192964, y: -2.0062397, z: 8.0234375}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &5279176810039195611
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1896072655702505677}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cd3bf3610d18aa14e805185b5e3f2d4b, type: 3}
m_Name:
m_EditorClassIdentifier:
bombPrefab: {fileID: 5909392949477884267, guid: 28467e0d65b5d3844bf1862ac0c49ad9,
type: 3}

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 55efdd6010414554092e24563071b9f7
guid: 142c20937b0ba4d1b9a77c8504dda487
folderAsset: yes
DefaultImporter:
externalObjects: {}

View file

@ -11,6 +11,7 @@ GameObject:
- component: {fileID: 2219719956326328737}
- component: {fileID: 2976769454423190410}
- component: {fileID: 5317321277803550577}
- component: {fileID: 5518668270798060090}
m_Layer: 0
m_Name: Explosion
m_TagString: Explosion
@ -71,6 +72,18 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 0.5, y: 0.5}
m_EdgeRadius: 0
--- !u!114 &5518668270798060090
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2086996798441195857}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 00b7acc459217644283ce8202cadcded, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &5120645164323341697
GameObject:
m_ObjectHideFlags: 0

View file

@ -1,6 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &2377911311221568072
--- !u!1 &1566036887972620463
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -8,38 +8,36 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7980903176349258245}
- component: {fileID: 6699440875015304414}
- component: {fileID: 7875732231624854186}
- component: {fileID: 5909025813549437813}
- component: {fileID: 8259350758463922881}
- component: {fileID: 3408177363536354565}
m_Layer: 0
m_Name: BombsUpgrade
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7980903176349258245
--- !u!4 &8259350758463922881
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2377911311221568072}
m_GameObject: {fileID: 1566036887972620463}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_Father: {fileID: 7980903176349258245}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &6699440875015304414
--- !u!212 &3408177363536354565
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2377911311221568072}
m_GameObject: {fileID: 1566036887972620463}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
@ -69,9 +67,9 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 753e29d30d8044605aede9853c9308c7, type: 3}
m_Color: {r: 0.9485793, g: 0, b: 1, a: 1}
m_SortingOrder: -1
m_Sprite: {fileID: 21300002, guid: 5b4a5aab9761a49faa85fef071ef948c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
@ -81,6 +79,39 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &2377911311221568072
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7980903176349258245}
- component: {fileID: 7875732231624854186}
- component: {fileID: 5909025813549437813}
m_Layer: 0
m_Name: BombUpgrade
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7980903176349258245
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2377911311221568072}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 8259350758463922881}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &7875732231624854186
BoxCollider2D:
m_ObjectHideFlags: 0

View file

@ -9,7 +9,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 3243993883904879596}
- component: {fileID: 3212428174306319952}
- component: {fileID: 3858379993772342456}
- component: {fileID: 1949159407646367785}
m_Layer: 0
@ -27,60 +26,13 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1538214466168189615}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 10.299996, y: -4.6040254, z: -0.13553935}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 4532808296901133986}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &3212428174306319952
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1538214466168189615}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: ac1b266a61f9d43feb33de3a91647f99, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.32, y: 0.32}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &3858379993772342456
MonoBehaviour:
m_ObjectHideFlags: 0
@ -119,3 +71,82 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 0.1, y: 0.8}
m_EdgeRadius: 0
--- !u!1 &3021161452740670333
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4532808296901133986}
- component: {fileID: 191386183797221936}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4532808296901133986
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3021161452740670333}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3243993883904879596}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &191386183797221936
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3021161452740670333}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 7f28d6dcaa824294aa07212b8b0f9bc5, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0

View file

@ -1,6 +1,6 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7385886653159515755
--- !u!1 &687830553201031435
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
@ -8,39 +8,36 @@ GameObject:
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 685382037628668327}
- component: {fileID: 7037551310800415105}
- component: {fileID: 7958292204112110464}
- component: {fileID: 5334633105760309190}
- component: {fileID: 6293070509487257227}
- component: {fileID: 7203846401108240184}
- component: {fileID: 734903871276958427}
m_Layer: 0
m_Name: FlameUpgrade
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &685382037628668327
--- !u!4 &7203846401108240184
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7385886653159515755}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_GameObject: {fileID: 687830553201031435}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.5, y: 0.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_Father: {fileID: 685382037628668327}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7037551310800415105
--- !u!212 &734903871276958427
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7385886653159515755}
m_GameObject: {fileID: 687830553201031435}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
@ -70,9 +67,9 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 753e29d30d8044605aede9853c9308c7, type: 3}
m_Color: {r: 1, g: 0.1812256, b: 0, a: 1}
m_SortingOrder: -1
m_Sprite: {fileID: 21300004, guid: 5b4a5aab9761a49faa85fef071ef948c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
@ -82,6 +79,39 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &7385886653159515755
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 685382037628668327}
- component: {fileID: 7958292204112110464}
- component: {fileID: 5334633105760309190}
m_Layer: 0
m_Name: FlameUpgrade
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &685382037628668327
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7385886653159515755}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 7203846401108240184}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!61 &7958292204112110464
BoxCollider2D:
m_ObjectHideFlags: 0
@ -120,15 +150,3 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 94153367f2364ab38597c8f4a6521909, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &6293070509487257227
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7385886653159515755}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 94153367f2364ab38597c8f4a6521909, type: 3}
m_Name:
m_EditorClassIdentifier:

View file

@ -0,0 +1,152 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1820949686450855695
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5028610574346420729}
- component: {fileID: 7106954491075610430}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5028610574346420729
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820949686450855695}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5103883358052461890}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7106954491075610430
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1820949686450855695}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: -1
m_Sprite: {fileID: 21300000, guid: 5b4a5aab9761a49faa85fef071ef948c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &4467162782262204990
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5103883358052461890}
- component: {fileID: 234472779121130071}
- component: {fileID: 5391029322786980951}
m_Layer: 0
m_Name: GoldenBombUpgrade
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &5103883358052461890
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4467162782262204990}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 226.39688, y: 753.2948, z: -16.29858}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 5028610574346420729}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &234472779121130071
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4467162782262204990}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 13e9051b005746efb7e4ab749d62ad03, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!61 &5391029322786980951
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4467162782262204990}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.5, y: 0.5}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
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

View file

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c9b7903151183144dbf30c9b2ab371b2
guid: f981d1f62161f491eb8e3806305c32a7
PrefabImporter:
externalObjects: {}
userData:

View file

@ -9,7 +9,6 @@ GameObject:
serializedVersion: 6
m_Component:
- component: {fileID: 5958400204756161002}
- component: {fileID: 7382262205660184478}
- component: {fileID: 2747432428292150867}
- component: {fileID: 6291791717356696744}
m_Layer: 0
@ -29,58 +28,11 @@ Transform:
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Children:
- {fileID: 3765005714787864007}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &7382262205660184478
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4242909486338491383}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 753e29d30d8044605aede9853c9308c7, type: 3}
m_Color: {r: 0.97521883, g: 0.9811321, b: 0, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!61 &2747432428292150867
BoxCollider2D:
m_ObjectHideFlags: 0
@ -119,3 +71,82 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0b8c723aa8c7476789cbee67fcadfbef, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &8860579196177115379
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3765005714787864007}
- component: {fileID: 2705328157713901762}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3765005714787864007
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8860579196177115379}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 5958400204756161002}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &2705328157713901762
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8860579196177115379}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: -1
m_Sprite: {fileID: 21300006, guid: 5b4a5aab9761a49faa85fef071ef948c, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 1, y: 1}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0

View file

@ -10,8 +10,6 @@ GameObject:
m_Component:
- component: {fileID: 158905820630581587}
- component: {fileID: 158905820630581586}
- component: {fileID: 158905820630581596}
- component: {fileID: 6316647355651322741}
m_Layer: 0
m_Name: GameManager
m_TagString: Untagged
@ -47,31 +45,3 @@ MonoBehaviour:
m_EditorClassIdentifier:
preStageUiPrefab: {fileID: 4994633962466276707, guid: 1f5ebc13237e070449ea8bc9e8b07ac8,
type: 3}
--- !u!114 &158905820630581596
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 158905820630581597}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 308dfc6b26c3b422faf1717231fc888b, type: 3}
m_Name:
m_EditorClassIdentifier:
boardHolder: {fileID: 0}
startPosition: {fileID: 0}
indestructibleWallPrefab: {fileID: 5996206011854593075, guid: 84b92ac1e96d940bda97d1b1125887d7,
type: 3}
--- !u!114 &6316647355651322741
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 158905820630581597}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e64481d2e18e4b6ca4f22926a5061450, type: 3}
m_Name:
m_EditorClassIdentifier:

View file

@ -69,7 +69,7 @@ SpriteRenderer:
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 10
m_Sprite: {fileID: 21300064, guid: 9f5aa0a5274004a2d9ed6d24d3790c5f, type: 3}
m_Sprite: {fileID: 21300072, guid: 9f5aa0a5274004a2d9ed6d24d3790c5f, type: 3}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_FlipX: 0
m_FlipY: 0
@ -145,6 +145,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: e3cc05deb3d6e44128ad7bc8610cedac, type: 3}
m_Name:
m_EditorClassIdentifier:
godMode: 0
movementSpeed: 4
--- !u!50 &6843575828445418653
Rigidbody2D:

View file

@ -10,7 +10,6 @@ GameObject:
m_Component:
- component: {fileID: 5407421983573782568}
- component: {fileID: 8221087269156402184}
- component: {fileID: 9007082834052858790}
m_Layer: 0
m_Name: Sprite
m_TagString: Untagged
@ -80,25 +79,6 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!95 &9007082834052858790
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2151260512302392238}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: f99f14e77d0442846ba579190dffc1c2, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0
--- !u!1 &8729402555587492036
GameObject:
m_ObjectHideFlags: 0

View file

@ -121,7 +121,6 @@ GameObject:
m_Component:
- component: {fileID: 8553251917334281199}
- component: {fileID: 2562328647522734305}
- component: {fileID: 1235137903643130781}
m_Layer: 8
m_Name: Sprite
m_TagString: Untagged
@ -191,22 +190,3 @@ SpriteRenderer:
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!95 &1235137903643130781
Animator:
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5688352134163068791}
m_Enabled: 1
m_Avatar: {fileID: 0}
m_Controller: {fileID: 9100000, guid: f99f14e77d0442846ba579190dffc1c2, type: 2}
m_CullingMode: 0
m_UpdateMode: 0
m_ApplyRootMotion: 0
m_LinearVelocityBlending: 0
m_WarningMessage:
m_HasTransformHierarchy: 1
m_AllowConstantClipSamplingOptimization: 1
m_KeepAnimatorControllerStateOnDisable: 0

View file

@ -136,75 +136,6 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 6843575829779162303}
m_PrefabAsset: {fileID: 0}
--- !u!1001 &2013742123
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1896072655702505677, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_Name
value: BombSpawner
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_RootOrder
value: 7
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1896072655702505676, guid: c9b7903151183144dbf30c9b2ab371b2,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c9b7903151183144dbf30c9b2ab371b2, type: 3}
--- !u!1001 &158905819792232859
PrefabInstance:
m_ObjectHideFlags: 0
@ -212,6 +143,14 @@ PrefabInstance:
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 0}
propertyPath: boardHolder
value:
objectReference: {fileID: 585332173}
- target: {fileID: 0}
propertyPath: startPosition
value:
objectReference: {fileID: 185746015}
- target: {fileID: 158905820630581597, guid: fdaa7451ab31b477b930076bbc888bab,
type: 3}
propertyPath: m_Name
@ -272,16 +211,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 158905820630581596, guid: fdaa7451ab31b477b930076bbc888bab,
type: 3}
propertyPath: boardHolder
value:
objectReference: {fileID: 585332173}
- target: {fileID: 158905820630581596, guid: fdaa7451ab31b477b930076bbc888bab,
type: 3}
propertyPath: startPosition
value:
objectReference: {fileID: 185746015}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: fdaa7451ab31b477b930076bbc888bab, type: 3}
--- !u!1001 &485484359436847253
@ -299,7 +228,7 @@ PrefabInstance:
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
propertyPath: m_LocalPosition.x
value: 12.62452
value: 11.490717
objectReference: {fileID: 0}
- target: {fileID: 485484359815032853, guid: a977eab75b5324ec4b659c2e2a0e9cfd,
type: 3}
@ -403,7 +332,7 @@ PrefabInstance:
- target: {fileID: 2219516564235934920, guid: 4ca131020414f4b1597dac2e1d292d7f,
type: 3}
propertyPath: m_RootOrder
value: 8
value: 7
objectReference: {fileID: 0}
- target: {fileID: 2219516564235934920, guid: 4ca131020414f4b1597dac2e1d292d7f,
type: 3}

View file

@ -6,3 +6,5 @@ Installed Packages:
====
Cinemachine 2.2.9
TextMeshPro 1.4.1
PixelPerfect 1.0.1

View file

@ -1,25 +0,0 @@
using src.Base;
using src.Managers;
using UnityEngine;
namespace src.Ammo
{
public class BombsSpawner : GameplayComponent
{
public GameObject bombPrefab;
private readonly BombsUtilManager _bombsUtil = BombsUtilManager.Instance;
public void PlaceBomb(Transform transform)
{
var absX = Mathf.RoundToInt(transform.position.x);
var absY = Mathf.RoundToInt(transform.position.y);
var position = new Vector2(absX, absY);
if (_bombsUtil.CanPlaceBomb(position))
{
Instantiate(bombPrefab, position, Quaternion.identity);
_bombsUtil.PlaceBomb(position);
}
}
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: cd3bf3610d18aa14e805185b5e3f2d4b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,115 +1,136 @@
using src.Helpers;
using src.Managers;
using System.Collections;
using System.Collections;
using System.Collections.Generic;
using src.Helpers;
using src.Managers;
using UnityEngine;
public abstract class EnemyBase : MonoBehaviour, IExplosable
namespace src.Base
{
protected Vector2[] _directions = { Vector3.up, Vector3.down, Vector3.left, Vector3.right };
protected readonly GameStateManager gameStateManager = GameStateManager.Instance;
protected Rigidbody2D Rigidbody2d { get; set; }
protected float Speed { get; set; }
protected Vector2 Direction { get; set; }
private List<Vector3> _allowedDirections = new List<Vector3>();
private bool _isStucked = false;
private System.Random _random = new System.Random();
// Start is called before the first frame update
protected void Start()
public abstract class EnemyBase : GameplayComponent, IExplosable
{
Direction = _directions.ChoseRandom();
Rigidbody2d = GetComponent<Rigidbody2D>();
}
private readonly Vector2[] _directions = {Vector3.up, Vector3.down, Vector3.left, Vector3.right};
private readonly GameStateManager _gameStateManager = GameStateManager.instance;
// Update is called once per frame
protected void FixedUpdate()
{
if (gameStateManager.IsGamePaused || gameStateManager.IsPlayerMovementForbidden) {return;}
if(_isStucked)
protected Rigidbody2D Rigidbody2d { get; set; }
private Collider2D Collider2D { get; set; }
private Animator Animator { get; set; }
protected float Speed { get; set; }
protected Vector2 Direction { get; set; }
private readonly List<Vector3> _allowedDirections = new List<Vector3>();
private bool _isStuck;
private bool _isDead;
private static readonly int AnimExplode = Animator.StringToHash("animExplode");
// Start is called before the first frame update
protected void Start()
{
Direction = _directions.ChoseRandom();
Rigidbody2d = GetComponent<Rigidbody2D>();
Collider2D = GetComponent<Collider2D>();
Animator = GetComponentInChildren<Animator>();
}
// Update is called once per frame
protected void FixedUpdate()
{
if (_gameStateManager.IsGamePaused || _gameStateManager.IsPlayerMovementForbidden || _isDead)
{
return;
}
if (_isStuck)
{
Unstuck();
}
HandleMovement();
}
/// <summary>
/// This function is implemented by subclasses and should provided personalized movement logic.
/// </summary>
protected abstract void HandleMovement();
public void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Explosion"))
{
OnExplosion();
}
}
public void OnExplosion()
{
Collider2D.enabled = false;
_isDead = true;
Animator.SetTrigger(AnimExplode);
Destroy(gameObject, 0.7f);
}
public void OnCollisionEnter2D(Collision2D col)
{
MoveToCenterOfTheCell();
Unstuck();
}
Rigidbody2d.MovePosition(Rigidbody2d.position + Speed * Time.deltaTime * Direction);
}
public void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Explosion"))
public void OnCollisionStay2D(Collision2D col)
{
onExplosion();
MoveToCenterOfTheCell();
Unstuck();
}
protected void MoveToCenterOfTheCell()
{
var position = transform.position;
var absX = Mathf.RoundToInt(position.x);
var absY = Mathf.RoundToInt(position.y);
var newPosition = new Vector2(absX, absY);
transform.SetPositionAndRotation(newPosition, Quaternion.identity);
}
protected Vector2 ChooseRandomDirection()
{
return _directions.ChoseRandom();
}
protected Vector2 ChooseRandomExceptCertainDirection(Vector2 direction)
{
return _directions.ChoseRandomExcept(direction);
}
private void Unstuck()
{
_allowedDirections.Clear();
StartCoroutine(CheckForObstacle(Vector3.down));
StartCoroutine(CheckForObstacle(Vector3.left));
StartCoroutine(CheckForObstacle(Vector3.up));
StartCoroutine(CheckForObstacle(Vector3.right));
if (_allowedDirections.Count == 0)
{
_isStuck = true;
}
else
{
Direction = _allowedDirections.PeekRandom();
_isStuck = false;
}
}
private IEnumerator CheckForObstacle(Vector3 direction)
{
const int layerMask = 1 << 8; // Block layer
var currentPosition = transform.position;
var hit = Physics2D.Raycast(new Vector2(currentPosition.x + 0.5f, currentPosition.y + 0.5f),
direction, 1, layerMask);
if (!hit.collider)
{
_allowedDirections.Add(direction);
}
yield return new WaitForSeconds(0.05f);
}
}
public void onExplosion()
{
Destroy(gameObject);
}
public void OnCollisionEnter2D(Collision2D col)
{
MoveToCenterOfTheCell();
Unstuck();
}
public void OnCollisionStay2D(Collision2D col)
{
MoveToCenterOfTheCell();
Unstuck();
}
protected void MoveToCenterOfTheCell()
{
var absX = Mathf.RoundToInt(transform.position.x);
var absY = Mathf.RoundToInt(transform.position.y);
Vector2 position = new Vector2(absX, absY);
transform.SetPositionAndRotation(position, Quaternion.identity);
}
protected Vector2 ChooseRandomDirection()
{
return _directions.ChoseRandom();
}
protected Vector2 ChooseRandomExceptCertainDirection(Vector2 direction)
{
return _directions.ChoseRandomExcept(direction);
}
private void Unstuck()
{
_allowedDirections.Clear();
StartCoroutine(CheckForObstacle(Vector3.down));
StartCoroutine(CheckForObstacle(Vector3.left));
StartCoroutine(CheckForObstacle(Vector3.up));
StartCoroutine(CheckForObstacle(Vector3.right));
if(_allowedDirections.Count == 0)
{
_isStucked = true;
}
else
{
var index = _random.Next(_allowedDirections.Count);
Direction = _allowedDirections[index];
_isStucked = false;
}
}
private IEnumerator CheckForObstacle(Vector3 direction)
{
var layerMask = (1 << 8) | (1 << 9);
var currentPosition = transform.position;
var hit = Physics2D.Raycast(new Vector2(currentPosition.x + 0.5f, currentPosition.y + 0.5f), direction, 1, layerMask);
if (!hit.collider)
{
_allowedDirections.Add(direction);
}
yield return new WaitForSeconds(0.05f);
}
}
}

View file

@ -1,46 +0,0 @@
using System;
using src.Helpers;
using UnityEngine;
namespace src.Base
{
public abstract class PlayerBase : GameplayComponent, IExplosable
{
public float movementSpeed = 4f;
/* Movement */
protected Rigidbody2D rigidbody2d;
protected void Start()
{
rigidbody2d = GetComponent<Rigidbody2D>();
}
public void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Explosion"))
{
onExplosion();
}
if (other.CompareTag("Enemy"))
{
OnContactWithEnemy();
}
}
public void onExplosion()
{
DebugHelper.LogInfo("Player hit by explosion");
}
private void OnContactWithEnemy()
{
DebugHelper.LogInfo("Player hit by enemy");
}
public void IncreaseSpeed(float speed)
{
movementSpeed += speed;
}
}
}

View file

@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: d928d20fbd868432d806ad1035e67e15
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,18 +1,19 @@
using src.Interfaces;
using src.Managers;
using src.Player;
using src.Upgrade;
using UnityEngine;
namespace src.Base
{
public class UpgradeBase : GameplayComponent, IUpgrade
{
protected GameManager GameManager;
private UpgradeManager _upgradeManager;
protected PlayerController PlayerToUpgrade;
public void Start()
{
GameManager = GameManager.Instance;
_upgradeManager = UpgradeManager.Instance;
_upgradeManager = UpgradeManager.instance;
}
public virtual void PerformUpgrade()
@ -23,6 +24,7 @@ namespace src.Base
public void OnTriggerEnter2D(Collider2D other)
{
if (!other.CompareTag("Player")) return;
PlayerToUpgrade = other.GetComponent<PlayerController>();
PerformUpgrade();
_upgradeManager.ClaimUpgrade(gameObject);
Destroy(gameObject);

View file

@ -4,11 +4,11 @@ using src.Base;
using src.Managers;
using UnityEngine;
namespace src.Ammo
namespace src.Bomb
{
public class BombCameraShake : GameplayComponent
{
private readonly BombsUtilManager _bombsUtilManager = BombsUtilManager.Instance;
private BombsUtilManager _bombsUtilManager;
public float amplitudeGain = 3f;
public float frequencyGain = 3f;
@ -18,6 +18,7 @@ namespace src.Ammo
// Start is called before the first frame update
private void Start()
{
_bombsUtilManager = BombsUtilManager.instance;
_virtualCamera = GetComponent<CinemachineVirtualCamera>();
_noiseMachine = _virtualCamera.GetCinemachineComponent<CinemachineBasicMultiChannelPerlin>();
}
@ -29,7 +30,7 @@ namespace src.Ammo
private IEnumerator _startCameraShake()
{
SetCameraNoise(amplitudeGain, frequencyGain);
yield return new WaitForSeconds(_bombsUtilManager.ExplosionDuration);
yield return new WaitForSeconds(_bombsUtilManager.explosionDuration);
SetCameraNoise(0, 0);
}

View file

@ -4,29 +4,28 @@ using src.Helpers;
using src.Managers;
using UnityEngine;
namespace src.Ammo
namespace src.Bomb
{
public class BombController : GameplayComponent, IExplosable
{
public GameObject explosionPrefab;
private readonly BombsUtilManager _bombsUtil = BombsUtilManager.instance;
private BombCameraShake _cameraShake;
private readonly BombsUtilManager _bombsUtil = BombsUtilManager.Instance;
private SpriteRenderer _spriteRenderer;
private bool _exploded;
// Start is called before the first frame update
void Start()
private void Start()
{
_cameraShake = GameObject.Find("VCAM1").GetComponent<BombCameraShake>();
Invoke(nameof(Explode), _bombsUtil.Timer);
_spriteRenderer = GetComponentInChildren<SpriteRenderer>();
Invoke(nameof(Explode), _bombsUtil.timer);
}
void Explode()
private void Explode()
{
Instantiate(explosionPrefab, transform.position, Quaternion.identity);
GetComponentInChildren<SpriteRenderer>().enabled = false;
Instantiate(PrefabAtlas.BombExplosion, transform.position, Quaternion.identity);
_spriteRenderer.enabled = false;
_cameraShake.StartCameraShakeCoro();
StartCoroutine(CreateExplosions(Vector3.down));
StartCoroutine(CreateExplosions(Vector3.left));
@ -42,21 +41,20 @@ namespace src.Ammo
private IEnumerator CreateExplosions(Vector3 direction)
{
var currentPosition = transform.position;
for (var i = 1; i < _bombsUtil.Power; i++)
for (var i = 1; i < _bombsUtil.power; i++)
{
var hit = Physics2D.Raycast(new Vector2(currentPosition.x + 0.5f,
currentPosition.y + 0.5f), direction, i, 1 << 8);
if (!hit.collider)
{
Instantiate(explosionPrefab, transform.position + i * direction,
explosionPrefab.transform.rotation);
Instantiate(PrefabAtlas.BombExplosion, transform.position + i * direction,
PrefabAtlas.BombExplosion.transform.rotation);
}
else
{
Debug.Log("Hit something");
var key = hit.collider.GetComponent<IExplosable>();
key?.onExplosion();
key?.OnExplosion();
break;
}
}
@ -68,19 +66,19 @@ namespace src.Ammo
{
if (!_exploded && other.CompareTag("Explosion"))
{
onExplosion();
OnExplosion();
}
}
public void onExplosion()
public void OnExplosion()
{
CancelInvoke(nameof(Explode));
Explode();
}
public void OnDestroy()
{
_bombsUtil.RemoveBomb(transform.position);
{
_bombsUtil.UnregisterBomb(transform.position);
}
}
}

View file

@ -1,15 +1,15 @@
using src.Base;
using src.Managers;
namespace src.Ammo
namespace src.Bomb
{
public class Explosion : GameplayComponent
public class BombExplosion : GameplayComponent
{
private readonly BombsUtilManager _bombUtil = BombsUtilManager.Instance;
private readonly BombsUtilManager _bombUtil = BombsUtilManager.instance;
public void Start()
{
Destroy(gameObject, _bombUtil.ExplosionDuration);
Destroy(gameObject, _bombUtil.explosionDuration);
}
}
}

View file

@ -1,4 +1,7 @@
namespace src.Enemy
using src.Base;
using UnityEngine;
namespace src.Enemy
{
public class CollisionMovementEnemy : EnemyBase
/* Enemy that will change direction only on collision. */
@ -9,10 +12,9 @@
base.Start();
}
protected new void FixedUpdate()
protected override void HandleMovement()
{
base.FixedUpdate();
Rigidbody2d.MovePosition(Rigidbody2d.position + Speed * Time.deltaTime * Direction);
}
}
}

View file

@ -1,8 +0,0 @@
fileFormatVersion: 2
guid: 738f4be39c8d33d4dbfe91e24b6b1b63
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -1,27 +1,21 @@
using UnityEngine;
using src.Base;
using UnityEngine;
namespace Assets.Scripts.src.Enemy.Dummy
namespace src.Enemy.Dummy
{
//This kind of enemy is used just for testing purposes
//This enemy will go just in one direction or stays in place
//To make it stay in place, don't assign any direction in OneDirection slot or assign Vector2.zero
public class OneDirectionEnemy : EnemyBase
{
public Vector2 OneDirection = Vector2.zero;
protected new void Start()
{
Speed = 4.0f;
Rigidbody2d = GetComponent<Rigidbody2D>();
}
protected new void FixedUpdate()
protected override void HandleMovement()
{
if (OneDirection != Vector2.zero)
{
if (gameStateManager.IsGamePaused || gameStateManager.IsPlayerMovementForbidden) { return; }
Rigidbody2d.MovePosition(Rigidbody2d.position + OneDirection * Speed * Time.deltaTime);
}
}
}
}

View file

@ -1,5 +1,5 @@
using System;
using src.Helpers;
using src.Base;
using UnityEngine;
namespace src.Enemy
@ -13,12 +13,11 @@ namespace src.Enemy
base.Start();
}
protected new void FixedUpdate()
protected override void HandleMovement()
{
var pos = transform.position;
var x = pos.x;
var y = pos.y;
if (gameStateManager.IsGamePaused || gameStateManager.IsPlayerMovementForbidden) { return; }
if (Math.Abs(x - Mathf.Floor(x)) < 0.1 && Math.Abs(y - Mathf.Floor(y)) < 0.1)
{
if (RandomChange())

View file

@ -5,7 +5,7 @@ namespace src.Helpers
{
public static class ApplicationActions
{
private static GameStateManager _gameStateManager = GameStateManager.Instance;
private static GameStateManager _gameStateManager = GameStateManager.instance;
public static void QuitGame()
{

View file

@ -12,7 +12,7 @@ namespace src.Helpers
var max = list.Count - 1;
for (var i = min; i < max; i++)
{
var randomPos = Mathf.FloorToInt(Random.Range(min, max));
var randomPos = Random.Range(min, max);
/* Swap elements in list */
var aux = list[randomPos];
@ -23,10 +23,16 @@ namespace src.Helpers
public static T PopRandom<T>(this IList<T> list)
{
var randomIndex = Mathf.FloorToInt(Random.Range(0, list.Count - 1));
var randomIndex = Random.Range(0, list.Count - 1);
var elem = list[randomIndex];
list.RemoveAt(randomIndex);
return elem;
}
public static T PeekRandom<T>(this IList<T> list)
{
var randomIndex = Random.Range(0, list.Count - 1);
return list[randomIndex];
}
}
}

View file

@ -4,6 +4,10 @@ namespace src.Helpers
{
public static class PrefabAtlas
{
/* UI */
public static readonly GameObject PreStageUi =
Resources.Load<GameObject>("UI/PreStageUI");
/* Snow Walls */
public static readonly GameObject DestructibleHighSnow =
Resources.Load<GameObject>("Walls/destructible_high_snow");
@ -14,11 +18,21 @@ namespace src.Helpers
/* Upgrades */
public static readonly GameObject SpeedIncreaseUpgrade =
Resources.Load<GameObject>("DevMocks/SpeedUpgrade");
Resources.Load<GameObject>("Items/SpeedUpgrade");
public static readonly GameObject BombsIncreaseUpgrade =
Resources.Load<GameObject>("DevMocks/BombsUpgrade");
Resources.Load<GameObject>("Items/BombUpgrade");
public static readonly GameObject FlamesIncreaseUpgrade =
Resources.Load<GameObject>("DevMocks/FlameUpgrade");
Resources.Load<GameObject>("Items/FlameUpgrade");
public static readonly GameObject GoldenBombUpgrade =
Resources.Load<GameObject>("Items/GoldenBombUpgrade");
/* Items */
public static readonly GameObject Bomb =
Resources.Load<GameObject>("Items/Bomb");
public static readonly GameObject BombExplosion =
Resources.Load<GameObject>("Items/BombExplosion");
public static readonly GameObject ExitDoor =
Resources.Load<GameObject>("Items/ExitDoor");
/* Enemies */
public static readonly GameObject GreenEnemy = Resources.Load<GameObject>("Enemies/SnowEnemyRandom");

View file

@ -4,5 +4,5 @@ using UnityEngine;
public interface IExplosable
{
void onExplosion();
void OnExplosion();
}

View file

@ -2,7 +2,6 @@ using src.Helpers;
namespace src.Level
{
using System;
using UnityEngine;
namespace src.Level
@ -22,11 +21,16 @@ namespace src.Level
public static class LevelResource
{
private static readonly GameObject[] AllUpgrades =
{PrefabAtlas.FlamesIncreaseUpgrade, PrefabAtlas.BombsIncreaseUpgrade, PrefabAtlas.SpeedIncreaseUpgrade};
{
PrefabAtlas.FlamesIncreaseUpgrade, PrefabAtlas.BombsIncreaseUpgrade, PrefabAtlas.SpeedIncreaseUpgrade,
PrefabAtlas.GoldenBombUpgrade
};
private static readonly GameObject[] SnowWallsDestructible =
{PrefabAtlas.DestructibleSnow, PrefabAtlas.DestructibleHighSnow};
private static readonly GameObject[] SnowWallsIndestructible = {PrefabAtlas.IndestructibleWoodCrate};
/* Used to store information about the level. */
private static readonly LevelData[] LevelData =
{

View file

@ -15,29 +15,10 @@ namespace src.Level
private const int XMaxEnemyPosition = 5;
private const int YMinEnemyPosition = -5;
public Count DestructibleWallCount
{
get => _destructibleWallCount;
set => _destructibleWallCount = value;
}
public Count UpgradesCount
{
get => _upgradesCount;
set => _upgradesCount = value;
}
public Count EnemyCount
{
get => _enemyCount;
set => _enemyCount = value;
}
/* Used to group spawned objects */
public Transform boardHolder;
private Transform _boardHolder;
/* Holds the starting position of the player */
public Transform startPosition;
private Transform _startPosition;
/* Holds references to prefabs for the specified level. */
private GameObject _indestructibleWallPrefab;
@ -57,11 +38,20 @@ namespace src.Level
/* Holds the available positions */
private readonly List<Vector3> _freeGridPositionsBoard = new List<Vector3>();
private List<Vector3> _freeGridPositions;
/* Holds initialized game objects */
private List<GameObject> _destructibleWalls;
private List<GameObject> _enemies;
/* Singletons */
private GameStateManager _gameStateManager = GameStateManager.Instance;
private GameStateManager _gameStateManager;
public void Awake()
{
_startPosition = GameObject.Find("RespawnPosition").GetComponent<Transform>();
_boardHolder = GameObject.Find("Grid").GetComponent<Transform>();
_gameStateManager = GameStateManager.instance;
}
public void SetLevelData(LevelData levelData)
{
@ -115,9 +105,9 @@ namespace src.Level
}
/* We want to iterate over the X axis taking into consideration the startPosition's offset */
for (var x = startPosition.position.x; x < Columns; x++)
for (var x = _startPosition.position.x; x < Columns; x++)
{
for (var y = startPosition.position.y; y > Rows * -1; y--)
for (var y = _startPosition.position.y; y > Rows * -1; y--)
{
/* We want the following positions to be a safe zone. */
/* Don't place anything on starting position */
@ -156,7 +146,7 @@ namespace src.Level
private void SetupLevelDestructibleWalls()
{
var numberOfWallsRemaining = _destructibleWallCount.RandomIntRange();
List<Vector3> usedPositions = new List<Vector3>();
var usedPositions = new List<Vector3>();
_freeGridPositions.ShuffleList();
foreach (var nextPosition in _freeGridPositions)
{
@ -182,7 +172,7 @@ namespace src.Level
var randomWall = _destructibleWallPrefabs.ChoseRandom();
var instance = Instantiate(randomWall, position, Quaternion.identity);
_destructibleWalls.Add(instance);
instance.transform.SetParent(boardHolder);
instance.transform.SetParent(_boardHolder);
}
private bool PlaceIndestructibleTile(float x, float y)
@ -198,7 +188,7 @@ namespace src.Level
var instance =
Instantiate(_indestructibleWallPrefab, new Vector3(x, y, 0f), Quaternion.identity);
instance.transform.SetParent(boardHolder);
instance.transform.SetParent(_boardHolder);
return true;
}
@ -223,7 +213,7 @@ namespace src.Level
DebugHelper.LogVerbose($"PlaceEnemy: x:{position.x} y:{position.y}");
var randomEnemy = _enemiesPrefab.ChoseRandom();
var instance = Instantiate(randomEnemy, position, Quaternion.identity);
instance.transform.SetParent(boardHolder);
instance.transform.SetParent(_boardHolder);
_enemies.Add(instance);
}

View file

@ -1,68 +1,69 @@
using System.Collections.Generic;
using src.Base;
using UnityEngine;
namespace src.Managers
{
public sealed class BombsUtilManager
public sealed class BombsUtilManager : GameplayComponent
{
private readonly HashSet<Vector3> _usedPosition = new HashSet<Vector3>();
public static BombsUtilManager instance;
public int power = 3;
public int allowedBombs = 2;
public int placedBombs = 0;
public float timer = 3.0f;
public float explosionDuration = 0.55f;
private static readonly HashSet<Vector3> UsedPosition = new HashSet<Vector3>();
private const int MaxPower = 7;
private const int MaxAllowedBombs = 10;
public int Power { get; private set; } = 3;
public int AllowedBombs { get; private set; } = 2;
public int PlacedBombs { get; private set; } = 0;
public float Timer { get; } = 3.0f;
public float ExplosionDuration { get; } = 0.55f;
private BombsUtilManager()
public void Awake()
{
if (instance == null)
{
instance = this;
}
else if (instance != null)
{
Destroy(gameObject);
}
}
public static BombsUtilManager Instance { get; } = new BombsUtilManager();
public void IncreasePower()
{
if (Power <= MaxPower)
if (power <= MaxPower)
{
Power++;
power++;
}
}
public void IncreaseAllowedBombs()
{
if (AllowedBombs <= MaxAllowedBombs)
if (allowedBombs <= MaxAllowedBombs)
{
AllowedBombs++;
allowedBombs++;
}
}
public void PlaceBomb(Vector3 position)
public void RegisterBomb(Vector3 position)
{
if (CanPlaceBomb(position))
{
PlacedBombs++;
_usedPosition.Add(position);
}
if (!CanPlaceBomb(position)) return;
placedBombs++;
UsedPosition.Add(position);
}
public void RemoveBomb(Vector3 position)
public void UnregisterBomb(Vector3 position)
{
if (_usedPosition.Contains(position))
{
PlacedBombs--;
_usedPosition.Remove(position);
}
if (!UsedPosition.Contains(position)) return;
placedBombs--;
UsedPosition.Remove(position);
}
public bool CanPlaceBomb(Vector3 position)
{
return (!_usedPosition.Contains(position) && (PlacedBombs < AllowedBombs));
return !UsedPosition.Contains(position) && placedBombs < allowedBombs;
}
}
}

View file

@ -1,24 +1,22 @@
using System.Collections;
using src.Ammo;
using src.Helpers;
using src.Level;
using src.Level.src.Level;
using src.Player;
using UnityEngine;
using UnityEngine.SceneManagement;
namespace src.Managers
{
public class GameManager : MonoBehaviour
{
public static GameManager Instance;
// Inner Components
private PlayerController _playerController;
private GameStateManager _gameStateManager;
private LevelManager _levelManager;
private UpgradeManager _upgradeManager;
private BombsUtilManager _bombsUtilManager;
// External Components
public GameObject preStageUiPrefab;
private PlayerController _playerController;
private readonly GameStateManager _gameStateManager = GameStateManager.Instance;
public void Awake()
{
@ -34,10 +32,10 @@ namespace src.Managers
/* Don't destroy when reloading the scene */
DontDestroyOnLoad(gameObject);
// Load inner components
_levelManager = GetComponent<LevelManager>();
_upgradeManager = GetComponent<UpgradeManager>();
_bombsUtilManager = BombsUtilManager.Instance;
// Load singletons
_gameStateManager = gameObject.AddComponent<GameStateManager>();
_levelManager = gameObject.AddComponent<LevelManager>();
_upgradeManager = gameObject.AddComponent<UpgradeManager>();
// Load external components
_playerController = GameObject.Find("Player").GetComponent<PlayerController>();
@ -64,15 +62,10 @@ namespace src.Managers
{
return _upgradeManager;
}
public BombsUtilManager GetBombsUtilManager()
{
return _bombsUtilManager;
}
private IEnumerator PreInitGame()
{
var preStageUi = Instantiate(preStageUiPrefab); // Will destroy itself.
var preStageUi = Instantiate(PrefabAtlas.PreStageUi); // Will destroy itself.
preStageUi.SetActive(true);
yield return new WaitForSeconds(1f);
Destroy(preStageUi);
@ -94,6 +87,21 @@ namespace src.Managers
ApplicationActions.HandlePauseKey();
}
}
private IEnumerator GameOver()
{
yield return new WaitForSeconds(4f);
_levelManager.DestroyLevel();
_upgradeManager.DestroyUnclaimedUpgrades();
_gameStateManager.ResetLevel();
StartLevel();
_playerController.Respawn();
}
public void StartGameOver()
{
StartCoroutine(GameOver());
}
public void StartNextLevel()
{

View file

@ -1,18 +1,37 @@
using src.Base;
using UnityEngine;
namespace src.Managers
{
public class GameStateManager
public class GameStateManager : GameplayComponent
{
public static GameStateManager Instance { get; } = new GameStateManager();
public static GameStateManager instance;
public bool IsGamePaused { get; internal set; }
public bool IsPlayerMovementForbidden { get; internal set; }
public int Level { get; private set; } = 1;
public void Awake()
{
if (instance == null)
{
instance = this;
}
else if (instance != null)
{
Destroy(gameObject);
}
}
public void IncreaseLevel()
{
Level += 1;
}
public void ResetLevel()
{
Level = 1;
}
}
}

View file

@ -10,17 +10,17 @@ namespace src.Managers
{
public class UpgradeManager : GameplayComponent, IDynamicLevelData
{
public static UpgradeManager Instance;
public static UpgradeManager instance;
private List<GameObject> _unclaimedUpgrades = new List<GameObject>();
private GameObject[] _upgradePrefabs;
private void Awake()
{
if (Instance == null)
if (instance == null)
{
Instance = this;
instance = this;
}
else if (Instance != null)
else if (instance != null)
{
Destroy(gameObject);
}

View file

@ -1,56 +1,113 @@
using src.Ammo;
using System;
using System.ComponentModel;
using src.Base;
using src.Helpers;
using src.Interfaces;
using src.Managers;
using UnityEngine;
using UnityStandardAssets.CrossPlatformInput;
namespace src.Player
{
public class PlayerController : PlayerBase
public class PlayerController : GameplayComponent, IExplosable
{
private GameStateManager _gameStateManager = GameStateManager.Instance;
public bool godMode;
public float movementSpeed = 4f;
/* Components */
private GameStateManager _gameStateManager;
private Rigidbody2D _rigidbody2d;
private Collider2D _collider2D;
private Transform _respawnPosition;
private BombsSpawner _bombsSpawner;
private BombsUtilManager _bombsUtilManager;
private Animator _animator;
private PlayerUpgrade _playerUpgrade;
/* Variables */
private bool _isDead;
/* Animator Variables*/
private static readonly int AnimHorizontal = Animator.StringToHash("AnimHorizontal");
private static readonly int AnimVertical = Animator.StringToHash("AnimVertical");
private static readonly int AnimDeath = Animator.StringToHash("AnimDeath");
protected new void Start()
protected void Awake()
{
base.Start();
_playerUpgrade = gameObject.AddComponent<PlayerUpgrade>();
_bombsUtilManager = gameObject.AddComponent<BombsUtilManager>();
}
_respawnPosition = GameObject.Find("RespawnPosition").transform;
_bombsSpawner = GameObject.Find("BombSpawner").GetComponent<BombsSpawner>();
protected void Start()
{
_gameStateManager = GameStateManager.instance;
_rigidbody2d = GetComponent<Rigidbody2D>();
_collider2D = GetComponent<Collider2D>();
_animator = GetComponentInChildren<Animator>();
_playerUpgrade = PlayerUpgrade.Instance;
_respawnPosition = GameObject.Find("RespawnPosition").transform;
movementSpeed = _playerUpgrade.GetMovementSpeed();
_playerUpgrade.PlayerSpeed += IncreaseSpeed;
_playerUpgrade.PlayerSpeed += OnSpeedUpgrade;
#if UNITY_EDITOR
godMode = true;
#endif
Respawn();
}
private void FixedUpdate()
{
if (_gameStateManager.IsGamePaused || _gameStateManager.IsPlayerMovementForbidden) {return;}
HandleMovement();
if (_gameStateManager.IsGamePaused || _gameStateManager.IsPlayerMovementForbidden || _isDead) {return;}
HandleMovementInput();
}
private void Update()
{
if (_gameStateManager.IsGamePaused || _gameStateManager.IsPlayerMovementForbidden) {return;}
HandleBomb();
if (_gameStateManager.IsGamePaused || _gameStateManager.IsPlayerMovementForbidden || _isDead) {return;}
HandleItemsInput();
}
private void HandleMovement()
private void HandleMovementInput()
{
#if UNITY_STANDALONE || UNITY_WEBGL || UNITY_EDITOR
HandleKeyboardMovement();
#elif UNITY_IOS || UNITY_ANDROID
HandleTouchMovement();
#elif UNITY_PS4 || UNITY_XBOXONE
HandlerControllerMovement();
#endif
}
private void HandleItemsInput()
{
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL
if (Input.GetKeyDown(KeyCode.Space))
{
PlaceBomb();
}
#elif UNITY_IOS || UNITY_ANDROID
if (CrossPlatformInputManager.GetButton("PlaceBomb"))
{
PlaceBomb();
}
#elif UNITY_PS4 || UNITY_XBOXONE
// Console bomb placement is not supported yet.
#endif
}
#if UNITY_STANDALONE || UNITY_WEBGL || UNITY_EDITOR
private void HandleKeyboardMovement()
{
var horizontal = Input.GetAxisRaw("Horizontal");
var vertical = Input.GetAxisRaw("Vertical");
#elif UNITY_IOS || UNITY_ANDROID
var movementVector = new Vector2(horizontal, vertical);
MovePosition(movementVector);
}
#endif
#if UNITY_IOS || UNITY_ANDROID
private void HandleTouchMovement()
{
var horizontal = 0;
var vertical = 0;
if (CrossPlatformInputManager.GetButton("MoveUp"))
@ -69,54 +126,100 @@ namespace src.Player
{
horizontal = -1;
}
#elif UNITY_PS4 || UNITY_XBOXONE
// // Console movement is not supported yet.
var movementVector = new Vector2(horizontal, vertical);
MovePosition(movementVector);
}
#endif
var movementVector = new Vector2(horizontal, vertical).NormalizeToCross();
#if UNITY_PS4 || UNITY_XBOXONE
private void HandlerControllerMovement()
{
throw new NotImplementedException();
}
#endif
private void MovePosition(Vector2 movementVector)
{
movementVector = movementVector.NormalizeToCross();
_animator.SetFloat(AnimHorizontal, movementVector.x);
_animator.SetFloat(AnimVertical, movementVector.y);
rigidbody2d.MovePosition(rigidbody2d.position + movementSpeed * Time.deltaTime * movementVector);
_rigidbody2d.MovePosition(_rigidbody2d.position + movementSpeed * Time.deltaTime * movementVector);
}
private void PlaceBomb()
{
_bombsSpawner.PlaceBomb(transform);
var position = transform.position;
var absX = Mathf.RoundToInt(position.x);
var absY = Mathf.RoundToInt(position.y);
var newPosition = new Vector2(absX, absY);
if (!_bombsUtilManager.CanPlaceBomb(newPosition)) return;
Instantiate(PrefabAtlas.Bomb, newPosition, Quaternion.identity);
_bombsUtilManager.RegisterBomb(newPosition);
}
private void HandleBomb()
{
#if UNITY_EDITOR || UNITY_STANDALONE || UNITY_WEBGL
if (Input.GetKeyDown(KeyCode.Space))
{
PlaceBomb();
}
#elif UNITY_IOS || UNITY_ANDROID
if (CrossPlatformInputManager.GetButton("PlaceBomb"))
{
PlaceBomb();
}
#elif UNITY_PS4 || UNITY_XBOXONE
// Console bomb placement is not supported yet.
#endif
}
public void Respawn()
{
DebugHelper.LogInfo("Player is respawning!");
DebugHelper.LogInfo("Player is re-spawning!");
_isDead = false;
_collider2D.enabled = true;
_animator.SetBool(AnimDeath, false);
transform.SetPositionAndRotation(_respawnPosition.position, Quaternion.identity);
_animator.Play("IdleDown");
}
private void Die()
{
if (godMode)
{
return;
}
_isDead = true;
_collider2D.enabled = false;
_animator.SetBool(AnimDeath, true);
GameManager.Instance.StartGameOver();
}
public void OnTriggerExit2D(Collider2D other)
{
/* Turn off bomb trigger making it so you can't pass through. */
if (other.CompareTag("Bomb"))
{
other.isTrigger = false;
}
}
public void OnCollisionEnter2D(Collision2D other)
{
if (other.collider.CompareTag("Enemy"))
{
OnContactWithEnemy();
}
}
public void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Explosion"))
{
OnExplosion();
}
}
public void OnExplosion()
{
DebugHelper.LogInfo("Player hit by explosion");
Die();
}
private void OnContactWithEnemy()
{
DebugHelper.LogInfo("Player hit by enemy");
Die();
}
private void OnSpeedUpgrade(float speed)
{
movementSpeed += speed;
}
}
}

View file

@ -1,18 +1,17 @@
using src.Base;
namespace src.Player
{
public class PlayerUpgrade
public class PlayerUpgrade : GameplayComponent
{
/* Events & Delegates */
public delegate void IncreaseSpeedDelegate(float speed);
public static PlayerUpgrade Instance = new PlayerUpgrade();
public event IncreaseSpeedDelegate PlayerSpeed;
/* Variables */
public const float MaxPlayerSpeed = 8f;
private float _movementSpeed = 4f;
private PlayerUpgrade()
{
}
public float GetMovementSpeed()
{
return _movementSpeed;
@ -25,7 +24,7 @@ namespace src.Player
return;
}
_movementSpeed += speed;
PlayerSpeed.Invoke(speed);
PlayerSpeed?.Invoke(speed);
}
}
}

View file

@ -7,7 +7,7 @@ namespace src.UI
{
public class PreStageUiScript : GameplayComponent
{
private readonly GameStateManager _gameStateManager = GameStateManager.Instance;
private readonly GameStateManager _gameStateManager = GameStateManager.instance;
private Text _stageText;
public void Start()

View file

@ -1,4 +1,5 @@
using src.Base;
using src.Managers;
namespace src.Upgrade
{
@ -6,7 +7,7 @@ namespace src.Upgrade
{
public override void PerformUpgrade()
{
var bombManager = GameManager.GetBombsUtilManager();
var bombManager = PlayerToUpgrade.GetComponent<BombsUtilManager>();
bombManager.IncreasePower();
}
}

View file

@ -1,4 +1,5 @@
using src.Base;
using src.Managers;
namespace src.Upgrade
{
@ -6,7 +7,7 @@ namespace src.Upgrade
{
public override void PerformUpgrade()
{
var bombManager = GameManager.GetBombsUtilManager();
var bombManager = PlayerToUpgrade.GetComponent<BombsUtilManager>();
bombManager.IncreaseAllowedBombs();
}
}

View file

@ -0,0 +1,16 @@
using src.Base;
using src.Managers;
namespace src.Upgrade
{
/* Adds one firepower and one bomb. */
public class GoldenBombUpgrade : UpgradeBase
{
public override void PerformUpgrade()
{
var bombManager = PlayerToUpgrade.GetComponent<BombsUtilManager>();
bombManager.IncreaseAllowedBombs();
bombManager.IncreasePower();
}
}
}

View file

@ -0,0 +1,3 @@
fileFormatVersion: 2
guid: 13e9051b005746efb7e4ab749d62ad03
timeCreated: 1566031123

View file

@ -7,7 +7,7 @@ namespace src.Upgrade
{
public override void PerformUpgrade()
{
var player = PlayerUpgrade.Instance;
var player = PlayerToUpgrade.GetComponent<PlayerUpgrade>();
player.IncreaseSpeed(.5f);
}
}

View file

@ -1,4 +1,3 @@
using System;
using UnityEngine;
using src.Base;
@ -12,15 +11,14 @@ namespace src.Wall
private bool _spawnExit;
private bool _spawnUpgrade;
private UpgradeManager _upgradeManager;
public GameObject explosionPrefab;
public GameObject exitDoorPrefab;
private Animator _animator;
private GameObject _explosionPrefab;
private GameObject _exitDoorPrefab;
private void Start()
{
_upgradeManager = GameManager.Instance.GetUpgradeManager();
_animator = GetComponentInChildren<Animator>();
// _animator.speed = 0;
_explosionPrefab = PrefabAtlas.BombExplosion;
_exitDoorPrefab = PrefabAtlas.ExitDoor;
}
public void SpawnsExit()
@ -40,11 +38,11 @@ namespace src.Wall
{
var currentPosition = transform.position;
Destroy(GetComponent<SpriteRenderer>());
Instantiate(explosionPrefab, currentPosition, Quaternion.identity);
Instantiate(_explosionPrefab, currentPosition, Quaternion.identity);
if (_spawnExit)
{
DebugHelper.LogInfo($"Destructible spawned exit {transform.position}");
Instantiate(exitDoorPrefab, currentPosition, Quaternion.identity);
Instantiate(_exitDoorPrefab, currentPosition, Quaternion.identity);
}
else if (_spawnUpgrade)
{
@ -55,15 +53,9 @@ namespace src.Wall
}
}
private void PlayDestroyAnimation()
{
// _animator.speed = 10;
}
public void onExplosion()
public void OnExplosion()
{
DebugHelper.LogInfo($"Destructible wall hit by explosion {transform.position}");
PlayDestroyAnimation();
SpawnSomething();
Destroy(gameObject);
}

View file

@ -1,5 +1,6 @@
using System;
using src.Base;
using src.Helpers;
using src.Managers;
using UnityEngine;
@ -8,12 +9,10 @@ namespace src.Wall
public class ExitDoor : GameplayComponent
{
private GameManager _gameManager;
private Collider2D _collider2D;
private void Start()
{
_gameManager = GameManager.Instance;
_collider2D = GetComponent<Collider2D>();
}
/* Trigger the next level and destroy itself. */

View file

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 563 B

View file

@ -0,0 +1,110 @@
fileFormatVersion: 2
guid: 7f28d6dcaa824294aa07212b8b0f9bc5
TextureImporter:
fileIDToRecycleName: {}
externalObjects: {}
serializedVersion: 9
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 6
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: ccc5de5a9d6fee444af0b231cc93c724
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

View file

@ -0,0 +1,194 @@
fileFormatVersion: 2
guid: 5b4a5aab9761a49faa85fef071ef948c
TextureImporter:
fileIDToRecycleName:
21300000: upgrades_0
21300002: upgrades_1
21300004: upgrades_2
21300006: upgrades_3
externalObjects: {}
serializedVersion: 9
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
aniso: -1
mipBias: -100
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 6
spritePivot: {x: 0, y: 0}
spritePixelsToUnits: 32
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
platformSettings:
- serializedVersion: 2
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
- serializedVersion: 2
buildTarget: Android
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: upgrades_0
rect:
serializedVersion: 2
x: 0
y: 0
width: 32
height: 32
alignment: 6
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 25b2f4026159f4642ba9a7e973ac63b4
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: upgrades_1
rect:
serializedVersion: 2
x: 32
y: 0
width: 32
height: 32
alignment: 6
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: 54da74c4272e64e858f5be79168dd101
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: upgrades_2
rect:
serializedVersion: 2
x: 64
y: 0
width: 32
height: 32
alignment: 6
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: f3ec2b9ddf3e64c068a07d3120bad65f
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: upgrades_3
rect:
serializedVersion: 2
x: 96
y: 0
width: 32
height: 32
alignment: 6
pivot: {x: 0, y: 0}
border: {x: 0, y: 0, z: 0, w: 0}
outline: []
physicsShape: []
tessellationDetail: 0
bones: []
spriteID: dacf66ed1d17e437291ab74d1b8329dd
vertices: []
indices:
edges: []
weights: []
outline: []
physicsShape: []
bones: []
spriteID: ba1fc6bb779234f728847af2ddd7fdb4
vertices: []
indices:
edges: []
weights: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View file

@ -53,4 +53,4 @@ Physics2DSettings:
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
m_LayerCollisionMatrix: fffbffffff3bffffff3bffffffffffffff3bfffffffbfffffffffffffffffffffffbffffffffffffc80affffffffffffff7bfffffffbffffe93bffffe9abffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_LayerCollisionMatrix: fffbffffff3bffffff3bffffffffffffff3bfffffffbfffffffffffffffffffffffbffffffffffffc80affffffffffffff7bfffffffbffffe9bbffffe9ebffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff

6
README.md Normal file
View file

@ -0,0 +1,6 @@
# projekt-bombs
MAD Bombs source code repository.
Project written in Unity. Please install the packages from Assets/Scripts/Packages.md before loading this project into Unity.
You may play this game in your web browser: https://dnutiu.itch.io/snowpiercer-isog

41
enemy.patch Normal file
View file

@ -0,0 +1,41 @@
diff --git a/Assets/Scripts/src/Player/PlayerController.cs b/Assets/Scripts/src/Player/PlayerController.cs
index 943f824..86df39d 100644
--- a/Assets/Scripts/src/Player/PlayerController.cs
+++ b/Assets/Scripts/src/Player/PlayerController.cs
@@ -185,17 +185,21 @@ namespace src.Player
other.isTrigger = false;
}
}
-
+
+ public void OnCollisionEnter2D(Collision2D other)
+ {
+ if (other.collider.CompareTag("Enemy"))
+ {
+ OnContactWithEnemy();
+ }
+ }
+
public void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Explosion"))
{
OnExplosion();
}
- if (other.CompareTag("Enemy"))
- {
- OnContactWithEnemy();
- }
}
public void OnExplosion()
diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset
index 8c8f397..07be3db 100644
--- a/ProjectSettings/Physics2DSettings.asset
+++ b/ProjectSettings/Physics2DSettings.asset
@@ -53,4 +53,4 @@ Physics2DSettings:
m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432}
m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745}
m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804}
- m_LayerCollisionMatrix: fffbffffff3bffffff3bffffffffffffff3bfffffffbfffffffffffffffffffffffbffffffffffffc80affffffffffffff7bfffffffbffffe93bffffe9abffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
+ m_LayerCollisionMatrix: fffbffffff3bffffff3bffffffffffffff3bfffffffbfffffffffffffffffffffffbffffffffffffc80affffffffffffff7bfffffffbffffe9bbffffe9ebffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff