From ef10324f3c438dcc89a769b527d0737dfd09830a Mon Sep 17 00:00:00 2001
From: xhxy <2290327506@qq.com>
Date: Tue, 18 Mar 2025 22:32:00 +0800
Subject: [PATCH] =?UTF-8?q?=E8=B6=85=E7=BA=A7=E8=B1=86=E9=80=BB=E8=BE=91,?=
 =?UTF-8?q?=E4=B8=BB=E8=A7=92=E5=90=83=E8=B6=85=E7=BA=A7=E8=B1=86=E7=9B=B8?=
 =?UTF-8?q?=E5=85=B3?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../PacManAnimationInvincible.anim            | 314 ++++++++++++
 .../PacManAnimationInvincible.anim.meta       |   8 +
 .../PacManAnimation/PacManAnimator.controller | 147 ++++++
 Assets/Prefab/SuperDot.prefab                 | 137 ++++++
 Assets/Prefab/SuperDot.prefab.meta            |   7 +
 Assets/Scenes/SampleScene.unity               | 449 +++++++++++++++++-
 Assets/Scripts/Dot.cs                         |  12 +-
 Assets/Scripts/GameManager.cs                 |  37 +-
 Assets/Scripts/MapDot.cs                      |  43 +-
 Assets/Scripts/PacMan.cs                      |  32 +-
 Assets/Scripts/RedGhost.cs                    | 117 ++++-
 Assets/Sprites/Start 1.png.meta               |  31 +-
 Assets/Sprites/SuperDot.png.meta              |  33 +-
 13 files changed, 1330 insertions(+), 37 deletions(-)
 create mode 100644 Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim
 create mode 100644 Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim.meta
 create mode 100644 Assets/Prefab/SuperDot.prefab
 create mode 100644 Assets/Prefab/SuperDot.prefab.meta

diff --git a/Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim b/Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim
new file mode 100644
index 0000000..11f4ba4
--- /dev/null
+++ b/Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim
@@ -0,0 +1,314 @@
+%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: PacManAnimationInvincible
+  serializedVersion: 7
+  m_Legacy: 0
+  m_Compressed: 0
+  m_UseHighQualityCurve: 1
+  m_RotationCurves: []
+  m_CompressedRotationCurves: []
+  m_EulerCurves: []
+  m_PositionCurves: []
+  m_ScaleCurves: []
+  m_FloatCurves:
+  - serializedVersion: 2
+    curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0.9496855
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.1875
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.375
+        value: 0.9496855
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.r
+    path: 
+    classID: 212
+    script: {fileID: 0}
+    flags: 0
+  - serializedVersion: 2
+    curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.1875
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.375
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.g
+    path: 
+    classID: 212
+    script: {fileID: 0}
+    flags: 0
+  - serializedVersion: 2
+    curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.1875
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.375
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.b
+    path: 
+    classID: 212
+    script: {fileID: 0}
+    flags: 0
+  m_PPtrCurves: []
+  m_SampleRate: 16
+  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: 2526845255
+      script: {fileID: 0}
+      typeID: 212
+      customType: 0
+      isPPtrCurve: 0
+      isIntCurve: 0
+      isSerializeReferenceCurve: 0
+    - serializedVersion: 2
+      path: 0
+      attribute: 4215373228
+      script: {fileID: 0}
+      typeID: 212
+      customType: 0
+      isPPtrCurve: 0
+      isIntCurve: 0
+      isSerializeReferenceCurve: 0
+    - serializedVersion: 2
+      path: 0
+      attribute: 2334886179
+      script: {fileID: 0}
+      typeID: 212
+      customType: 0
+      isPPtrCurve: 0
+      isIntCurve: 0
+      isSerializeReferenceCurve: 0
+    pptrCurveMapping: []
+  m_AnimationClipSettings:
+    serializedVersion: 2
+    m_AdditiveReferencePoseClip: {fileID: 0}
+    m_AdditiveReferencePoseTime: 0
+    m_StartTime: 0
+    m_StopTime: 0.375
+    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:
+  - serializedVersion: 2
+    curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0.9496855
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.1875
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.375
+        value: 0.9496855
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.r
+    path: 
+    classID: 212
+    script: {fileID: 0}
+    flags: 0
+  - serializedVersion: 2
+    curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.1875
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.375
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.g
+    path: 
+    classID: 212
+    script: {fileID: 0}
+    flags: 0
+  - serializedVersion: 2
+    curve:
+      serializedVersion: 2
+      m_Curve:
+      - serializedVersion: 3
+        time: 0
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.1875
+        value: 1
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      - serializedVersion: 3
+        time: 0.375
+        value: 0
+        inSlope: 0
+        outSlope: 0
+        tangentMode: 136
+        weightedMode: 0
+        inWeight: 0.33333334
+        outWeight: 0.33333334
+      m_PreInfinity: 2
+      m_PostInfinity: 2
+      m_RotationOrder: 4
+    attribute: m_Color.b
+    path: 
+    classID: 212
+    script: {fileID: 0}
+    flags: 0
+  m_EulerEditorCurves: []
+  m_HasGenericRootTransform: 0
+  m_HasMotionFloatCurves: 0
+  m_Events: []
diff --git a/Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim.meta b/Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim.meta
new file mode 100644
index 0000000..e14f3ef
--- /dev/null
+++ b/Assets/Animation/PacManAnimation/PacManAnimationInvincible.anim.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: f87572913730f844c952ac9781f0a782
+NativeFormatImporter:
+  externalObjects: {}
+  mainObjectFileID: 7400000
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Assets/Animation/PacManAnimation/PacManAnimator.controller b/Assets/Animation/PacManAnimation/PacManAnimator.controller
index ea7ca12..f0f1b01 100644
--- a/Assets/Animation/PacManAnimation/PacManAnimator.controller
+++ b/Assets/Animation/PacManAnimation/PacManAnimator.controller
@@ -35,6 +35,33 @@ AnimatorStateMachine:
   m_ExitPosition: {x: 800, y: 120, z: 0}
   m_ParentStateMachinePosition: {x: 800, y: 20, z: 0}
   m_DefaultState: {fileID: -1507588986160956898}
+--- !u!1102 &-7693493414493414114
+AnimatorState:
+  serializedVersion: 6
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: PacManAnimationInvincible
+  m_Speed: 1
+  m_CycleOffset: 0
+  m_Transitions:
+  - {fileID: 3955369321047790400}
+  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: f87572913730f844c952ac9781f0a782, type: 2}
+  m_Tag: 
+  m_SpeedParameter: 
+  m_MirrorParameter: 
+  m_CycleOffsetParameter: 
+  m_TimeParameter: 
 --- !u!1101 &-5847010637854703736
 AnimatorStateTransition:
   m_ObjectHideFlags: 1
@@ -86,6 +113,33 @@ AnimatorState:
   m_MirrorParameter: 
   m_CycleOffsetParameter: 
   m_TimeParameter: 
+--- !u!1102 &-3124357350882508848
+AnimatorState:
+  serializedVersion: 6
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: New State
+  m_Speed: 1
+  m_CycleOffset: 0
+  m_Transitions:
+  - {fileID: 3821188314543389402}
+  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: 0}
+  m_Tag: 
+  m_SpeedParameter: 
+  m_MirrorParameter: 
+  m_CycleOffsetParameter: 
+  m_TimeParameter: 
 --- !u!1102 &-2740067373791882997
 AnimatorState:
   serializedVersion: 6
@@ -184,6 +238,12 @@ AnimatorController:
     m_DefaultInt: 0
     m_DefaultBool: 0
     m_Controller: {fileID: 9100000}
+  - m_Name: invincible
+    m_Type: 4
+    m_DefaultFloat: 0
+    m_DefaultInt: 0
+    m_DefaultBool: 0
+    m_Controller: {fileID: 9100000}
   m_AnimatorLayers:
   - serializedVersion: 5
     m_Name: Base Layer
@@ -197,6 +257,18 @@ AnimatorController:
     m_IKPass: 0
     m_SyncedLayerAffectsTiming: 0
     m_Controller: {fileID: 9100000}
+  - serializedVersion: 5
+    m_Name: Invincible
+    m_StateMachine: {fileID: 4816031162238018443}
+    m_Mask: {fileID: 0}
+    m_Motions: []
+    m_Behaviours: []
+    m_BlendingMode: 0
+    m_SyncedLayerIndex: -1
+    m_DefaultWeight: 1
+    m_IKPass: 0
+    m_SyncedLayerAffectsTiming: 0
+    m_Controller: {fileID: 9100000}
 --- !u!1101 &347333318754700490
 AnimatorStateTransition:
   m_ObjectHideFlags: 1
@@ -222,6 +294,81 @@ AnimatorStateTransition:
   m_InterruptionSource: 0
   m_OrderedInterruption: 1
   m_CanTransitionToSelf: 0
+--- !u!1101 &3821188314543389402
+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: invincible
+    m_EventTreshold: 0
+  m_DstStateMachine: {fileID: 0}
+  m_DstState: {fileID: -7693493414493414114}
+  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: 1
+--- !u!1101 &3955369321047790400
+AnimatorStateTransition:
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: 
+  m_Conditions:
+  - m_ConditionMode: 2
+    m_ConditionEvent: invincible
+    m_EventTreshold: 0
+  m_DstStateMachine: {fileID: 0}
+  m_DstState: {fileID: -3124357350882508848}
+  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: 1
+--- !u!1107 &4816031162238018443
+AnimatorStateMachine:
+  serializedVersion: 6
+  m_ObjectHideFlags: 1
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_Name: Invincible
+  m_ChildStates:
+  - serializedVersion: 1
+    m_State: {fileID: -7693493414493414114}
+    m_Position: {x: 280, y: 190, z: 0}
+  - serializedVersion: 1
+    m_State: {fileID: -3124357350882508848}
+    m_Position: {x: 280, y: 100, 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: -3124357350882508848}
 --- !u!1101 &5067011031635243373
 AnimatorStateTransition:
   m_ObjectHideFlags: 1
diff --git a/Assets/Prefab/SuperDot.prefab b/Assets/Prefab/SuperDot.prefab
new file mode 100644
index 0000000..1a25b2b
--- /dev/null
+++ b/Assets/Prefab/SuperDot.prefab
@@ -0,0 +1,137 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!1 &6814478176812782572
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 6382974124117038377}
+  - component: {fileID: 8025289975008275458}
+  - component: {fileID: 2034910792870494950}
+  - component: {fileID: 4440131118187616055}
+  m_Layer: 0
+  m_Name: SuperDot
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!4 &6382974124117038377
+Transform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6814478176812782572}
+  serializedVersion: 2
+  m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
+  m_LocalPosition: {x: -4.39, y: -1.88, z: 0}
+  m_LocalScale: {x: 0.06, y: 0.06, z: 0.06}
+  m_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 0}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!212 &8025289975008275458
+SpriteRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6814478176812782572}
+  m_Enabled: 1
+  m_CastShadows: 0
+  m_ReceiveShadows: 0
+  m_DynamicOccludee: 1
+  m_StaticShadowCaster: 0
+  m_MotionVectors: 1
+  m_LightProbeUsage: 1
+  m_ReflectionProbeUsage: 1
+  m_RayTracingMode: 0
+  m_RayTraceProcedural: 0
+  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_ReceiveGI: 1
+  m_PreserveUVs: 0
+  m_IgnoreNormalsForChartDetection: 0
+  m_ImportantGI: 0
+  m_StitchLightmapSeams: 1
+  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: a7271f92ce58fcd4a9d09049cb3806b9, type: 3}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_FlipX: 0
+  m_FlipY: 0
+  m_DrawMode: 0
+  m_Size: {x: 25.25, y: 25.625}
+  m_AdaptiveModeThreshold: 0.5
+  m_SpriteTileMode: 0
+  m_WasSpriteAssigned: 1
+  m_MaskInteraction: 0
+  m_SpriteSortPoint: 0
+--- !u!58 &2034910792870494950
+CircleCollider2D:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6814478176812782572}
+  m_Enabled: 1
+  m_Density: 1
+  m_Material: {fileID: 0}
+  m_IncludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ExcludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_LayerOverridePriority: 0
+  m_ForceSendLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_ForceReceiveLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_ContactCaptureLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_CallbackLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_IsTrigger: 1
+  m_UsedByEffector: 0
+  m_UsedByComposite: 0
+  m_Offset: {x: 0, y: 0}
+  serializedVersion: 2
+  m_Radius: 12.8125
+--- !u!114 &4440131118187616055
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 6814478176812782572}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: 885053369ca48744ea69847990c27ca4, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  Score: 100
+  SuperDot: 1
diff --git a/Assets/Prefab/SuperDot.prefab.meta b/Assets/Prefab/SuperDot.prefab.meta
new file mode 100644
index 0000000..a1d2103
--- /dev/null
+++ b/Assets/Prefab/SuperDot.prefab.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: dc30aa3569315e942aa45323cada1e07
+PrefabImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity
index ea60f4b..d151647 100644
--- a/Assets/Scenes/SampleScene.unity
+++ b/Assets/Scenes/SampleScene.unity
@@ -1501,6 +1501,9 @@ GameObject:
   m_Component:
   - component: {fileID: 319435253}
   - component: {fileID: 319435252}
+  - component: {fileID: 319435255}
+  - component: {fileID: 319435256}
+  - component: {fileID: 319435254}
   m_Layer: 0
   m_Name: RedGhost
   m_TagString: Untagged
@@ -1575,6 +1578,89 @@ Transform:
   m_Children: []
   m_Father: {fileID: 0}
   m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+--- !u!114 &319435254
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 319435251}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: ede5a0c1425ceaf498091d7de8ceb445, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  curstate: 0
+  rb: {fileID: 0}
+  anim: {fileID: 0}
+  PacMan: {fileID: 0}
+  ObstadeLayer:
+    serializedVersion: 2
+    m_Bits: 512
+  speed: 240
+  frightenedSpeed: 200
+--- !u!58 &319435255
+CircleCollider2D:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 319435251}
+  m_Enabled: 1
+  m_Density: 1
+  m_Material: {fileID: 6200000, guid: 73187bbc4ed751443a45a0176ac9cbdc, type: 2}
+  m_IncludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ExcludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_LayerOverridePriority: 0
+  m_ForceSendLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_ForceReceiveLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_ContactCaptureLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_CallbackLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_IsTrigger: 0
+  m_UsedByEffector: 0
+  m_UsedByComposite: 0
+  m_Offset: {x: 0, y: 0}
+  serializedVersion: 2
+  m_Radius: 0.77
+--- !u!50 &319435256
+Rigidbody2D:
+  serializedVersion: 4
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 319435251}
+  m_BodyType: 0
+  m_Simulated: 1
+  m_UseFullKinematicContacts: 0
+  m_UseAutoMass: 0
+  m_Mass: 1
+  m_LinearDrag: 0
+  m_AngularDrag: 0.05
+  m_GravityScale: 0
+  m_Material: {fileID: 0}
+  m_IncludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ExcludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_Interpolate: 0
+  m_SleepingMode: 1
+  m_CollisionDetection: 0
+  m_Constraints: 0
 --- !u!1 &328538338
 GameObject:
   m_ObjectHideFlags: 0
@@ -2061,7 +2147,9 @@ MonoBehaviour:
   m_EditorClassIdentifier: 
   Score: 0
   DotNum: 0
+  invincibleTime: 0
   scoreText: {fileID: 2022556643}
+  invincibleText: {fileID: 1275852502}
 --- !u!1 &731773885
 GameObject:
   m_ObjectHideFlags: 0
@@ -2205,6 +2293,7 @@ GameObject:
   m_Component:
   - component: {fileID: 743396948}
   - component: {fileID: 743396949}
+  - component: {fileID: 743396950}
   m_Layer: 11
   m_Name: dontInstantiateDot
   m_TagString: Untagged
@@ -2272,6 +2361,51 @@ BoxCollider2D:
   serializedVersion: 2
   m_Size: {x: 6.169568, y: 3.058305}
   m_EdgeRadius: 0
+--- !u!61 &743396950
+BoxCollider2D:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 743396947}
+  m_Enabled: 1
+  m_Density: 1
+  m_Material: {fileID: 0}
+  m_IncludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_ExcludeLayers:
+    serializedVersion: 2
+    m_Bits: 0
+  m_LayerOverridePriority: 0
+  m_ForceSendLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_ForceReceiveLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_ContactCaptureLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_CallbackLayers:
+    serializedVersion: 2
+    m_Bits: 4294967295
+  m_IsTrigger: 1
+  m_UsedByEffector: 0
+  m_UsedByComposite: 0
+  m_Offset: {x: 0, y: -1.97}
+  m_SpriteTilingProperty:
+    border: {x: 0, y: 0, z: 0, w: 0}
+    pivot: {x: 0, y: 0}
+    oldSize: {x: 0, y: 0}
+    newSize: {x: 0, y: 0}
+    adaptiveTilingThreshold: 0
+    drawMode: 0
+    adaptiveTiling: 0
+  m_AutoTiling: 0
+  serializedVersion: 2
+  m_Size: {x: 1.84, y: 1.96}
+  m_EdgeRadius: 0
 --- !u!1 &790867437
 GameObject:
   m_ObjectHideFlags: 0
@@ -2406,6 +2540,43 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 790867437}
   m_CullTransparentMesh: 1
+--- !u!1 &837134500
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 837134501}
+  m_Layer: 5
+  m_Name: Invincible
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &837134501
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 837134500}
+  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_ConstrainProportionsScale: 0
+  m_Children:
+  - {fileID: 2035196122}
+  - {fileID: 1275852501}
+  m_Father: {fileID: 1373016460}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 0, y: 0}
+  m_SizeDelta: {x: 0, y: 0}
+  m_Pivot: {x: 0, y: 1}
 --- !u!1 &859020883
 GameObject:
   m_ObjectHideFlags: 0
@@ -2797,7 +2968,9 @@ MonoBehaviour:
   m_Script: {fileID: 11500000, guid: df2a57e20cbb3a44587628987ef382db, type: 3}
   m_Name: 
   m_EditorClassIdentifier: 
-  pelletPrefab: {fileID: 2657837871138035131, guid: 0d8bc33082c2f0d4ba022cf458f0d689, type: 3}
+  DotPrefab: {fileID: 2657837871138035131, guid: 0d8bc33082c2f0d4ba022cf458f0d689, type: 3}
+  SuperDotPrefab: {fileID: 6814478176812782572, guid: dc30aa3569315e942aa45323cada1e07, type: 3}
+  SuperDotNum: 4
   ObstadeLayer:
     serializedVersion: 2
     m_Bits: 2624
@@ -2805,6 +2978,140 @@ MonoBehaviour:
   endPosGameObject: {fileID: 1626638292}
   startPos: {x: -5, y: -5}
   endPos: {x: 5, y: 5}
+--- !u!1 &1275852500
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 1275852501}
+  - component: {fileID: 1275852503}
+  - component: {fileID: 1275852502}
+  m_Layer: 5
+  m_Name: Num
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &1275852501
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1275852500}
+  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_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 837134501}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 344, y: -118.3}
+  m_SizeDelta: {x: 12.23, y: 50}
+  m_Pivot: {x: 0, y: 1}
+--- !u!114 &1275852502
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1275852500}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_text: 0
+  m_isRightToLeft: 0
+  m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
+  m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
+  m_fontSharedMaterials: []
+  m_fontMaterial: {fileID: 0}
+  m_fontMaterials: []
+  m_fontColor32:
+    serializedVersion: 2
+    rgba: 4294967295
+  m_fontColor: {r: 1, g: 1, b: 1, a: 1}
+  m_enableVertexGradient: 0
+  m_colorMode: 3
+  m_fontColorGradient:
+    topLeft: {r: 1, g: 1, b: 1, a: 1}
+    topRight: {r: 1, g: 1, b: 1, a: 1}
+    bottomLeft: {r: 1, g: 1, b: 1, a: 1}
+    bottomRight: {r: 1, g: 1, b: 1, a: 1}
+  m_fontColorGradientPreset: {fileID: 0}
+  m_spriteAsset: {fileID: 0}
+  m_tintAllSprites: 0
+  m_StyleSheet: {fileID: 0}
+  m_TextStyleHashCode: -1183493901
+  m_overrideHtmlColors: 0
+  m_faceColor:
+    serializedVersion: 2
+    rgba: 4294967295
+  m_fontSize: 70.2
+  m_fontSizeBase: 70.2
+  m_fontWeight: 400
+  m_enableAutoSizing: 0
+  m_fontSizeMin: 18
+  m_fontSizeMax: 72
+  m_fontStyle: 0
+  m_HorizontalAlignment: 1
+  m_VerticalAlignment: 512
+  m_textAlignment: 65535
+  m_characterSpacing: 0
+  m_wordSpacing: 0
+  m_lineSpacing: 0
+  m_lineSpacingMax: 0
+  m_paragraphSpacing: 0
+  m_charWidthMaxAdj: 0
+  m_enableWordWrapping: 1
+  m_wordWrappingRatios: 0.4
+  m_overflowMode: 0
+  m_linkedTextComponent: {fileID: 0}
+  parentLinkedComponent: {fileID: 0}
+  m_enableKerning: 1
+  m_enableExtraPadding: 0
+  checkPaddingRequired: 0
+  m_isRichText: 1
+  m_parseCtrlCharacters: 1
+  m_isOrthographic: 1
+  m_isCullingEnabled: 0
+  m_horizontalMapping: 0
+  m_verticalMapping: 0
+  m_uvLineOffset: 0
+  m_geometrySortingOrder: 0
+  m_IsTextObjectScaleStatic: 0
+  m_VertexBufferAutoSizeReduction: 0
+  m_useMaxVisibleDescender: 1
+  m_pageToDisplay: 1
+  m_margin: {x: 0, y: 0, z: -476.3435, w: -123.49658}
+  m_isUsingLegacyAnimationComponent: 0
+  m_isVolumetricText: 0
+  m_hasFontAssetChanged: 0
+  m_baseMaterial: {fileID: 0}
+  m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
+--- !u!222 &1275852503
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 1275852500}
+  m_CullTransparentMesh: 1
 --- !u!1 &1357585439
 GameObject:
   m_ObjectHideFlags: 0
@@ -3034,6 +3341,7 @@ RectTransform:
   m_ConstrainProportionsScale: 0
   m_Children:
   - {fileID: 2013941526}
+  - {fileID: 837134501}
   - {fileID: 731773886}
   - {fileID: 384304364}
   m_Father: {fileID: 0}
@@ -4592,9 +4900,12 @@ MonoBehaviour:
   m_Name: 
   m_EditorClassIdentifier: 
   rb: {fileID: 0}
-  animator: {fileID: 0}
+  anim: {fileID: 0}
   inputDirection: {x: 0, y: 0}
   speed: 300
+  invincible: 0
+  invincibleTime: 10
+  timer: 0
 --- !u!50 &1900762615
 Rigidbody2D:
   serializedVersion: 4
@@ -5108,6 +5419,140 @@ CanvasRenderer:
   m_PrefabAsset: {fileID: 0}
   m_GameObject: {fileID: 2022556641}
   m_CullTransparentMesh: 1
+--- !u!1 &2035196121
+GameObject:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  serializedVersion: 6
+  m_Component:
+  - component: {fileID: 2035196122}
+  - component: {fileID: 2035196124}
+  - component: {fileID: 2035196123}
+  m_Layer: 5
+  m_Name: Score
+  m_TagString: Untagged
+  m_Icon: {fileID: 0}
+  m_NavMeshLayer: 0
+  m_StaticEditorFlags: 0
+  m_IsActive: 1
+--- !u!224 &2035196122
+RectTransform:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2035196121}
+  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_ConstrainProportionsScale: 0
+  m_Children: []
+  m_Father: {fileID: 837134501}
+  m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
+  m_AnchorMin: {x: 0, y: 1}
+  m_AnchorMax: {x: 0, y: 1}
+  m_AnchoredPosition: {x: 0, y: -116.5}
+  m_SizeDelta: {x: 12.23, y: 50}
+  m_Pivot: {x: 0, y: 1}
+--- !u!114 &2035196123
+MonoBehaviour:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2035196121}
+  m_Enabled: 1
+  m_EditorHideFlags: 0
+  m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
+  m_Name: 
+  m_EditorClassIdentifier: 
+  m_Material: {fileID: 0}
+  m_Color: {r: 1, g: 1, b: 1, a: 1}
+  m_RaycastTarget: 1
+  m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
+  m_Maskable: 1
+  m_OnCullStateChanged:
+    m_PersistentCalls:
+      m_Calls: []
+  m_text: 'Invincible:'
+  m_isRightToLeft: 0
+  m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
+  m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
+  m_fontSharedMaterials: []
+  m_fontMaterial: {fileID: 0}
+  m_fontMaterials: []
+  m_fontColor32:
+    serializedVersion: 2
+    rgba: 4294967295
+  m_fontColor: {r: 1, g: 1, b: 1, a: 1}
+  m_enableVertexGradient: 0
+  m_colorMode: 3
+  m_fontColorGradient:
+    topLeft: {r: 1, g: 1, b: 1, a: 1}
+    topRight: {r: 1, g: 1, b: 1, a: 1}
+    bottomLeft: {r: 1, g: 1, b: 1, a: 1}
+    bottomRight: {r: 1, g: 1, b: 1, a: 1}
+  m_fontColorGradientPreset: {fileID: 0}
+  m_spriteAsset: {fileID: 0}
+  m_tintAllSprites: 0
+  m_StyleSheet: {fileID: 0}
+  m_TextStyleHashCode: -1183493901
+  m_overrideHtmlColors: 0
+  m_faceColor:
+    serializedVersion: 2
+    rgba: 4294967295
+  m_fontSize: 70.2
+  m_fontSizeBase: 70.2
+  m_fontWeight: 400
+  m_enableAutoSizing: 0
+  m_fontSizeMin: 18
+  m_fontSizeMax: 72
+  m_fontStyle: 0
+  m_HorizontalAlignment: 1
+  m_VerticalAlignment: 512
+  m_textAlignment: 65535
+  m_characterSpacing: 0
+  m_wordSpacing: 0
+  m_lineSpacing: 0
+  m_lineSpacingMax: 0
+  m_paragraphSpacing: 0
+  m_charWidthMaxAdj: 0
+  m_enableWordWrapping: 1
+  m_wordWrappingRatios: 0.4
+  m_overflowMode: 0
+  m_linkedTextComponent: {fileID: 0}
+  parentLinkedComponent: {fileID: 0}
+  m_enableKerning: 1
+  m_enableExtraPadding: 0
+  checkPaddingRequired: 0
+  m_isRichText: 1
+  m_parseCtrlCharacters: 1
+  m_isOrthographic: 1
+  m_isCullingEnabled: 0
+  m_horizontalMapping: 0
+  m_verticalMapping: 0
+  m_uvLineOffset: 0
+  m_geometrySortingOrder: 0
+  m_IsTextObjectScaleStatic: 0
+  m_VertexBufferAutoSizeReduction: 0
+  m_useMaxVisibleDescender: 1
+  m_pageToDisplay: 1
+  m_margin: {x: 0, y: 0, z: -332.4002, w: -123.49658}
+  m_isUsingLegacyAnimationComponent: 0
+  m_isVolumetricText: 0
+  m_hasFontAssetChanged: 0
+  m_baseMaterial: {fileID: 0}
+  m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
+--- !u!222 &2035196124
+CanvasRenderer:
+  m_ObjectHideFlags: 0
+  m_CorrespondingSourceObject: {fileID: 0}
+  m_PrefabInstance: {fileID: 0}
+  m_PrefabAsset: {fileID: 0}
+  m_GameObject: {fileID: 2035196121}
+  m_CullTransparentMesh: 1
 --- !u!1660057539 &9223372036854775807
 SceneRoots:
   m_ObjectHideFlags: 0
diff --git a/Assets/Scripts/Dot.cs b/Assets/Scripts/Dot.cs
index 6457c25..63f4985 100644
--- a/Assets/Scripts/Dot.cs
+++ b/Assets/Scripts/Dot.cs
@@ -5,7 +5,7 @@ using UnityEngine;
 public class Dot : MonoBehaviour
 {
     public float Score;
-
+    public bool SuperDot;//��������
 
 
     private void Awake()
@@ -16,7 +16,17 @@ public class Dot : MonoBehaviour
     {
         if(collision.gameObject.layer == LayerMask.NameToLayer("PacMan"))
         {
+            if (SuperDot && !collision.gameObject.GetComponent<PacMan>().invincible)
+            {
+                collision.gameObject.GetComponent<PacMan>().invincible = true;//���������޵�
+
+            }
+            else if(SuperDot)
+            {      
+                    collision.gameObject.GetComponent<PacMan>().timer = 0; //�����޵�ʱ��
+            }
             GameManager.instance.AddScore(Score);
+
             Destroy(this.gameObject);
         }
         
diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs
index d4beead..e402271 100644
--- a/Assets/Scripts/GameManager.cs
+++ b/Assets/Scripts/GameManager.cs
@@ -9,9 +9,11 @@ public class GameManager : MonoBehaviour
 
     public float Score;
     public int DotNum;
+    public float invincibleTime;//�޵�ʱ��
+
+    public TMPro.TextMeshProUGUI scoreText;//�����ı�
+    public TMPro.TextMeshProUGUI invincibleText;//�޵�ʱ���ı�
 
-    public TMPro.TextMeshProUGUI scoreText;
-    
 
 
     private void Awake()
@@ -27,6 +29,11 @@ public class GameManager : MonoBehaviour
             Destroy(gameObject);
         }
     }
+    private void Update()
+    {
+        UpdateInvincibleTime();
+    }
+
 
     // �Զ��ӷּ�������
     public void AddScore(float amount)
@@ -36,7 +43,7 @@ public class GameManager : MonoBehaviour
         UpdateScoreDisplay();
         if(DotNum<=0) 
         {
-
+            //��Ϸʤ��
         }
     }
 
@@ -54,4 +61,28 @@ public class GameManager : MonoBehaviour
         }
     }
 
+    private void UpdateInvincibleTime()
+    {
+        if (invincibleText != null)
+        {
+            invincibleText.text = invincibleTime.ToString();
+        }
+    }
+
+
+    public static float GetAnimaTime(Animator animtorName, string animName)//��ö���ʱ��
+    {
+        if (animtorName != null)
+        {
+            RuntimeAnimatorController AC = animtorName.runtimeAnimatorController;
+            foreach (var item in AC.animationClips)
+            {
+                if (item.name == animName)
+                {
+                    return item.length;
+                }
+            }
+        }
+        return 0;
+    }
 }
diff --git a/Assets/Scripts/MapDot.cs b/Assets/Scripts/MapDot.cs
index 0661aa7..ef2283c 100644
--- a/Assets/Scripts/MapDot.cs
+++ b/Assets/Scripts/MapDot.cs
@@ -5,8 +5,12 @@ using UnityEngine;
 
 public class MapDot : MonoBehaviour
 {
-    
-    public GameObject pelletPrefab;
+
+    public GameObject DotPrefab;
+    public GameObject SuperDotPrefab;
+
+    public int SuperDotNum;//�������ӵ�����
+
     public LayerMask ObstadeLayer;
 
     public GameObject startPosGameObject;
@@ -34,21 +38,48 @@ public class MapDot : MonoBehaviour
         float minY = Mathf.Min(startPos.y, endPos.y);
         float maxY = Mathf.Max(startPos.y, endPos.y);
 
+        List<Vector2> validPositions = new List<Vector2>();//�洢�����ɵ�λ��
+
         for (float x = minX; x <= maxX; x++)
         {
+            // int ram = Random.Range(0, 101);//�����
             for (float y = minY; y <= maxY; y++)
             {
                 Vector2 checkPos = new Vector2(x, y);
 
                 // ���Wall����ײ��
                 Collider2D hit = Physics2D.OverlapBox(checkPos, Vector2.one * 0.1f, 0, ObstadeLayer);
-                if (hit == null)
+                if (!hit)
                 {
-                    Instantiate(pelletPrefab, checkPos, Quaternion.identity, transform);
-                    GameManager.instance.AddDotNum(1);
-
+                    validPositions.Add(checkPos);
                 }
             }
         }
+
+        // �ڶ��׶Σ����ѡ�񳬼���λ��
+        List<Vector2> superDotPositions = new List<Vector2>();
+        int superDotCount = Mathf.Min(SuperDotNum, validPositions.Count);//���ᳬ����Χ
+
+        // ʹ��Fisher-Yatesϴ���㷨�������ѡ��
+        for (int i = 0; i < superDotCount; i++)
+        {
+            int randomIndex = Random.Range(i, validPositions.Count);//���
+            Vector2 temp = validPositions[i];
+            validPositions[i] = validPositions[randomIndex];
+            validPositions[randomIndex] = temp;
+
+            superDotPositions.Add(validPositions[i]);
+        }
+
+        // �����׶Σ�ʵ�������ж���
+        foreach (Vector2 pos in validPositions)
+        {
+            bool isSuperDot = superDotPositions.Contains(pos);//ѭ����ǰֵ�Dz��dz�����
+            GameObject prefab = isSuperDot ? SuperDotPrefab : DotPrefab;//��Ŀ
+            Instantiate(prefab, pos, Quaternion.identity, transform);
+            GameManager.instance.AddDotNum(1);
+        }
     }
+
 }
+
diff --git a/Assets/Scripts/PacMan.cs b/Assets/Scripts/PacMan.cs
index c22ea0e..40866cc 100644
--- a/Assets/Scripts/PacMan.cs
+++ b/Assets/Scripts/PacMan.cs
@@ -3,22 +3,27 @@ using System.Collections.Generic;
 using UnityEditorInternal;
 using UnityEngine;
 using UnityEngine.InputSystem;
+using UnityEngine.SocialPlatforms.Impl;
 
 public class PacMan : MonoBehaviour
 {
     public PacManInput pacManInputControl;//����ϵͳ
 
     public Rigidbody2D rb;
-    public Animator animator;
+    public Animator anim;
 
     public Vector2 inputDirection;//���뷽�����ֵ
     public float speed;//�ٶ�
 
+    public bool invincible;//�޵�
+    public float invincibleTime;//�޵�ʱ��
+    public float timer;//��ʱ��
+
     private void Awake()
     {
         pacManInputControl = new PacManInput();//newһ���µ�����ϵͳ
         rb = GetComponent<Rigidbody2D>();
-        animator = GetComponent<Animator>();
+        anim = GetComponent<Animator>();
     }
 
     private void OnEnable()
@@ -34,8 +39,12 @@ public class PacMan : MonoBehaviour
     private void Update()
     {
         inputDirection = pacManInputControl.PacManInputSystem.Move.ReadValue<Vector2>();//��ȡ��ֵ
+        if (invincible)
+        {
+            PacManInvincible();
+        }
+        
     }
-
     private void FixedUpdate()
     {
         Move();
@@ -49,7 +58,20 @@ public class PacMan : MonoBehaviour
 
     public void PacManAnimation()
     {
-        animator.SetFloat("H",inputDirection.x);
-        animator.SetFloat("V", inputDirection.y);
+        anim.SetFloat("H",inputDirection.x);
+        anim.SetFloat("V", inputDirection.y);
+        anim.SetBool("invincible", invincible);//�޵ж���
+    }
+
+    public void PacManInvincible()
+    {
+        timer += Time.deltaTime;
+        GameManager.instance.invincibleTime = (int)(invincibleTime-timer+1);
+        if (timer >= invincibleTime)
+        {
+            invincible = false;
+            timer = 0f; // ���ü�ʱ��
+            
+        }
     }
 }
diff --git a/Assets/Scripts/RedGhost.cs b/Assets/Scripts/RedGhost.cs
index 50c49ad..84a2005 100644
--- a/Assets/Scripts/RedGhost.cs
+++ b/Assets/Scripts/RedGhost.cs
@@ -1,18 +1,123 @@
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
 
 public class RedGhost : MonoBehaviour
 {
-    // Start is called before the first frame update
-    void Start()
+    // ========== ״̬ö�� ==========
+    public enum GhostState
     {
-        
+        Idle,        //���ֵĴ���
+        Start,      //�뿪���������
+        Chase,      // ׷��ģʽ
+        Frightened, // �־�ģʽ,����
+        Die       // ��������
+    }
+    public GhostState curstate;//��ǰö��
+
+    [Header("��������")]
+    public Rigidbody2D rb;
+    public Animator anim;
+    public GameObject pacMan;//�Զ�������
+    public LayerMask obstadeLayer;//ǽ�IJ㼶
+
+    [Header("׷�������߼����")]
+    private Vector2 currentDirection;
+
+    public float speed;//�����ٶ�
+    public float frightenedSpeed;//�����ٶ�
+
+    private void Awake()
+    {
+        rb = GetComponent<Rigidbody2D>();
+        // anim = GetComponent<Animator>();
+        pacMan = GameObject.Find("PacManPlayer");//�ҵ�����
     }
 
-    // Update is called once per frame
-    void Update()
+    private void Update()
     {
-        
+        switch (curstate)
+        {
+            case GhostState.Idle:
+                Idle();
+                break;
+            case GhostState.Start:
+                GhostStart();
+                break;
+            case GhostState.Chase:
+                Chase();
+                break;
+            case GhostState.Frightened:
+                Frightened();
+                break;
+            case GhostState.Die:
+                Die();
+                break;
+        }
+    }
+
+   
+    private void Idle()
+    {
+        curstate = GhostState.Chase;
+    }
+
+    private void GhostStart()
+    {
+        throw new NotImplementedException();
+    }
+
+
+    private void Chase()
+    {
+        UpdateMovement(pacMan.transform.position, true);
+        //anim.SetBool("Frightened", false);
+    }
+
+    private void Frightened()
+    {
+        throw new NotImplementedException();
+    }
+
+    private void Die()
+    {
+        throw new NotImplementedException();
+    }
+
+
+
+    // �����ƶ��߼���׷��/���ܹ��ã�
+    private void UpdateMovement(Vector2 targetPos, bool isChasing)
+    {
+        Vector2[] directions = { Vector2.up, Vector2.down, Vector2.left, Vector2.right };
+        Vector2 bestDir = Vector2.zero;
+        float bestValue = isChasing ? Mathf.Infinity : -Mathf.Infinity;//������󣬸������
+
+        foreach (Vector2 dir in directions)
+        {
+            if (dir == -currentDirection) continue; // ѭ�����ķ�����ڵ�ǰ�ĸ����򣬼���ִ�У���ֱֹ�ӻ�ͷ
+
+            RaycastHit2D hit = Physics2D.Raycast(transform.position, dir, 1f, obstadeLayer);//��ʼ�㣬���򣬳��ȣ�������
+            if (hit.collider != null) continue;
+
+            // ���㷽���ֵ
+            float distance = Vector2.Distance(rb.position + dir, targetPos);//��ǰ����ӷ���������Ŀ����������IJ�ֵ
+            float currentValue = isChasing ? distance : -distance;//��׷����������
+
+            if ((isChasing && currentValue < bestValue) || (!isChasing && currentValue > bestValue))
+            {
+                bestValue = currentValue;
+                bestDir = dir;
+            }
+        }
+
+        if (bestDir != Vector2.zero)
+        {
+            currentDirection = bestDir;
+            rb.velocity = currentDirection * (curstate == GhostState.Frightened ? frightenedSpeed : speed);
+            //anim.SetFloat("DirX", currentDirection.x);
+            //anim.SetFloat("DirY", currentDirection.y);
+        }
     }
 }
diff --git a/Assets/Sprites/Start 1.png.meta b/Assets/Sprites/Start 1.png.meta
index db3c4e9..e1c70fd 100644
--- a/Assets/Sprites/Start 1.png.meta	
+++ b/Assets/Sprites/Start 1.png.meta	
@@ -3,7 +3,7 @@ guid: 092a12bbf6635324cb28d59ed336f107
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}
-  serializedVersion: 12
+  serializedVersion: 13
   mipmaps:
     mipMapMode: 0
     enableMipMap: 0
@@ -20,11 +20,12 @@ TextureImporter:
     externalNormalMap: 0
     heightScale: 0.25
     normalMapFilter: 0
+    flipGreenChannel: 0
   isReadable: 0
   streamingMipmaps: 0
   streamingMipmapsPriority: 0
   vTOnly: 0
-  ignoreMasterTextureLimit: 0
+  ignoreMipmapLimit: 0
   grayScaleToAlpha: 0
   generateCubemap: 6
   cubemapConvolution: 0
@@ -33,7 +34,7 @@ TextureImporter:
   maxTextureSize: 2048
   textureSettings:
     serializedVersion: 2
-    filterMode: 1
+    filterMode: 0
     aniso: 1
     mipBias: 0
     wrapU: 1
@@ -63,6 +64,7 @@ TextureImporter:
   textureFormatSet: 0
   ignorePngGamma: 0
   applyGammaDecoding: 1
+  swizzle: 50462976
   cookieLightType: 1
   platformSettings:
   - serializedVersion: 3
@@ -75,8 +77,9 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 1
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   - serializedVersion: 3
     buildTarget: Standalone
     maxTextureSize: 2048
@@ -87,8 +90,9 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 1
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   - serializedVersion: 3
     buildTarget: Server
     maxTextureSize: 2048
@@ -99,8 +103,22 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
     forceMaximumCompressionQuality_BC6H_BC7: 1
+  - serializedVersion: 3
+    buildTarget: WebGL
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   spriteSheet:
     serializedVersion: 2
     sprites: []
@@ -115,9 +133,8 @@ TextureImporter:
     weights: []
     secondaryTextures: []
     nameFileIdTable: {}
-  spritePackingTag: 
+  mipmapLimitGroupName: 
   pSDRemoveMatte: 0
-  pSDShowRemoveMatteOption: 0
   userData: 
   assetBundleName: 
   assetBundleVariant: 
diff --git a/Assets/Sprites/SuperDot.png.meta b/Assets/Sprites/SuperDot.png.meta
index 525c7a1..2cf7a7b 100644
--- a/Assets/Sprites/SuperDot.png.meta
+++ b/Assets/Sprites/SuperDot.png.meta
@@ -3,7 +3,7 @@ guid: a7271f92ce58fcd4a9d09049cb3806b9
 TextureImporter:
   internalIDToNameTable: []
   externalObjects: {}
-  serializedVersion: 12
+  serializedVersion: 13
   mipmaps:
     mipMapMode: 0
     enableMipMap: 0
@@ -20,11 +20,12 @@ TextureImporter:
     externalNormalMap: 0
     heightScale: 0.25
     normalMapFilter: 0
+    flipGreenChannel: 0
   isReadable: 0
   streamingMipmaps: 0
   streamingMipmapsPriority: 0
   vTOnly: 0
-  ignoreMasterTextureLimit: 0
+  ignoreMipmapLimit: 0
   grayScaleToAlpha: 0
   generateCubemap: 6
   cubemapConvolution: 0
@@ -33,7 +34,7 @@ TextureImporter:
   maxTextureSize: 2048
   textureSettings:
     serializedVersion: 2
-    filterMode: 1
+    filterMode: 0
     aniso: 1
     mipBias: 0
     wrapU: 1
@@ -63,6 +64,7 @@ TextureImporter:
   textureFormatSet: 0
   ignorePngGamma: 0
   applyGammaDecoding: 1
+  swizzle: 50462976
   cookieLightType: 1
   platformSettings:
   - serializedVersion: 3
@@ -75,8 +77,9 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 1
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   - serializedVersion: 3
     buildTarget: Standalone
     maxTextureSize: 2048
@@ -87,8 +90,9 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
-    forceMaximumCompressionQuality_BC6H_BC7: 1
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   - serializedVersion: 3
     buildTarget: iPhone
     maxTextureSize: 2048
@@ -99,6 +103,7 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
     forceMaximumCompressionQuality_BC6H_BC7: 1
   - serializedVersion: 3
@@ -111,6 +116,7 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
     forceMaximumCompressionQuality_BC6H_BC7: 1
   - serializedVersion: 3
@@ -123,8 +129,22 @@ TextureImporter:
     crunchedCompression: 0
     allowsAlphaSplitting: 0
     overridden: 0
+    ignorePlatformSupport: 0
     androidETC2FallbackOverride: 0
     forceMaximumCompressionQuality_BC6H_BC7: 1
+  - serializedVersion: 3
+    buildTarget: WebGL
+    maxTextureSize: 2048
+    resizeAlgorithm: 0
+    textureFormat: -1
+    textureCompression: 1
+    compressionQuality: 50
+    crunchedCompression: 0
+    allowsAlphaSplitting: 0
+    overridden: 0
+    ignorePlatformSupport: 0
+    androidETC2FallbackOverride: 0
+    forceMaximumCompressionQuality_BC6H_BC7: 0
   spriteSheet:
     serializedVersion: 2
     sprites: []
@@ -139,9 +159,8 @@ TextureImporter:
     weights: []
     secondaryTextures: []
     nameFileIdTable: {}
-  spritePackingTag: 
+  mipmapLimitGroupName: 
   pSDRemoveMatte: 0
-  pSDShowRemoveMatteOption: 0
   userData: 
   assetBundleName: 
   assetBundleVariant: