Skip to content

Commit c253993

Browse files
authored
Merge pull request #12 from MrXMrQ/feature
Feature
2 parents 1e68595 + b983ca5 commit c253993

File tree

30 files changed

+1837
-72
lines changed

30 files changed

+1837
-72
lines changed

Assets/Prefabs/Player Adition/Clone/clone.prefab

Lines changed: 121 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ GameObject:
1010
m_Component:
1111
- component: {fileID: 6224442158176733025}
1212
- component: {fileID: 6111668740038467412}
13+
- component: {fileID: 8181934081239502409}
1314
- component: {fileID: 3474101802904519079}
1415
- component: {fileID: 5954124179205527272}
1516
- component: {fileID: -2376178413195141671}
@@ -29,7 +30,7 @@ Transform:
2930
m_GameObject: {fileID: 6625813557290402506}
3031
serializedVersion: 2
3132
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
32-
m_LocalPosition: {x: -6.51, y: -0.12, z: 0}
33+
m_LocalPosition: {x: 0, y: 0, z: 0}
3334
m_LocalScale: {x: 1, y: 1, z: 1}
3435
m_ConstrainProportionsScale: 0
3536
m_Children: []
@@ -75,7 +76,7 @@ SpriteRenderer:
7576
m_LightmapParameters: {fileID: 0}
7677
m_SortingLayerID: 0
7778
m_SortingLayer: 0
78-
m_SortingOrder: 0
79+
m_SortingOrder: 1
7980
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
8081
m_Color: {r: 1, g: 1, b: 1, a: 1}
8182
m_FlipX: 0
@@ -87,6 +88,119 @@ SpriteRenderer:
8788
m_WasSpriteAssigned: 1
8889
m_MaskInteraction: 0
8990
m_SpriteSortPoint: 0
91+
--- !u!96 &8181934081239502409
92+
TrailRenderer:
93+
serializedVersion: 3
94+
m_ObjectHideFlags: 0
95+
m_CorrespondingSourceObject: {fileID: 0}
96+
m_PrefabInstance: {fileID: 0}
97+
m_PrefabAsset: {fileID: 0}
98+
m_GameObject: {fileID: 6625813557290402506}
99+
m_Enabled: 1
100+
m_CastShadows: 1
101+
m_ReceiveShadows: 1
102+
m_DynamicOccludee: 1
103+
m_StaticShadowCaster: 0
104+
m_MotionVectors: 0
105+
m_LightProbeUsage: 0
106+
m_ReflectionProbeUsage: 0
107+
m_RayTracingMode: 0
108+
m_RayTraceProcedural: 0
109+
m_RenderingLayerMask: 1
110+
m_RendererPriority: 0
111+
m_Materials:
112+
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
113+
m_StaticBatchInfo:
114+
firstSubMesh: 0
115+
subMeshCount: 0
116+
m_StaticBatchRoot: {fileID: 0}
117+
m_ProbeAnchor: {fileID: 0}
118+
m_LightProbeVolumeOverride: {fileID: 0}
119+
m_ScaleInLightmap: 1
120+
m_ReceiveGI: 1
121+
m_PreserveUVs: 0
122+
m_IgnoreNormalsForChartDetection: 0
123+
m_ImportantGI: 0
124+
m_StitchLightmapSeams: 1
125+
m_SelectedEditorRenderState: 3
126+
m_MinimumChartSize: 4
127+
m_AutoUVMaxDistance: 0.5
128+
m_AutoUVMaxAngle: 89
129+
m_LightmapParameters: {fileID: 0}
130+
m_SortingLayerID: 0
131+
m_SortingLayer: 0
132+
m_SortingOrder: 1
133+
m_Time: 0.35
134+
m_PreviewTimeScale: 1
135+
m_Parameters:
136+
serializedVersion: 3
137+
widthMultiplier: 1
138+
widthCurve:
139+
serializedVersion: 2
140+
m_Curve:
141+
- serializedVersion: 3
142+
time: 0
143+
value: 1
144+
inSlope: 0
145+
outSlope: 0
146+
tangentMode: 0
147+
weightedMode: 0
148+
inWeight: 0
149+
outWeight: 0
150+
- serializedVersion: 3
151+
time: 0.3603352
152+
value: 0
153+
inSlope: 0
154+
outSlope: 0
155+
tangentMode: 0
156+
weightedMode: 0
157+
inWeight: 0
158+
outWeight: 0
159+
m_PreInfinity: 2
160+
m_PostInfinity: 2
161+
m_RotationOrder: 4
162+
colorGradient:
163+
serializedVersion: 2
164+
key0: {r: 1, g: 0, b: 0.042412758, a: 1}
165+
key1: {r: 1, g: 1, b: 1, a: 0}
166+
key2: {r: 1, g: 1, b: 1, a: 0}
167+
key3: {r: 0, g: 0, b: 0, a: 0}
168+
key4: {r: 0, g: 0, b: 0, a: 0}
169+
key5: {r: 0, g: 0, b: 0, a: 0}
170+
key6: {r: 0, g: 0, b: 0, a: 0}
171+
key7: {r: 0, g: 0, b: 0, a: 0}
172+
ctime0: 0
173+
ctime1: 65535
174+
ctime2: 65535
175+
ctime3: 0
176+
ctime4: 0
177+
ctime5: 0
178+
ctime6: 0
179+
ctime7: 0
180+
atime0: 0
181+
atime1: 65535
182+
atime2: 0
183+
atime3: 0
184+
atime4: 0
185+
atime5: 0
186+
atime6: 0
187+
atime7: 0
188+
m_Mode: 0
189+
m_ColorSpace: 0
190+
m_NumColorKeys: 2
191+
m_NumAlphaKeys: 2
192+
numCornerVertices: 0
193+
numCapVertices: 0
194+
alignment: 0
195+
textureMode: 0
196+
textureScale: {x: 1, y: 1}
197+
shadowBias: 0.5
198+
generateLightingData: 0
199+
m_MinVertexDistance: 0.1
200+
m_MaskInteraction: 0
201+
m_Autodestruct: 0
202+
m_Emitting: 1
203+
m_ApplyActiveColorSpace: 1
90204
--- !u!50 &3474101802904519079
91205
Rigidbody2D:
92206
serializedVersion: 4
@@ -171,8 +285,8 @@ MonoBehaviour:
171285
m_Script: {fileID: 11500000, guid: d4fcd02c84bb3d6438a6969094f70646, type: 3}
172286
m_Name:
173287
m_EditorClassIdentifier:
174-
player: {fileID: 3474101802904519079}
175-
movement_direction: {x: 0, y: 0}
176-
current_position: {x: 0, y: 0}
177-
shot_particles: {fileID: 3316150335570932208, guid: 69ae0e9ef21d2af42b0d12a54ae66b4d, type: 3}
178-
shot_cooldown: 0
288+
sprite_renderer: {fileID: 6111668740038467412}
289+
_max_distance: 0
290+
_shot_cooldown: 0
291+
MAX_LIFE_TIME: 9
292+
MIN_LIFE_TIME: 8

Assets/Prefabs/Player Adition/Turret/turret.prefab

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,7 @@ MonoBehaviour:
134134
m_Script: {fileID: 11500000, guid: 3c0e6b82feaef824f83351ea96bf47d7, type: 3}
135135
m_Name:
136136
m_EditorClassIdentifier:
137+
hit_particle: {fileID: 739995767386574900, guid: 917f021215eb0ec4183bd33e2134db29, type: 3}
137138
max_life_time: 4
138139
min_life_time: 5
139140
tag_to_detect: Asteroid

Assets/Resources/Scriptableobjects/Abilities/clone_ability.asset

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,12 @@ MonoBehaviour:
1313
m_Name: clone_ability
1414
m_EditorClassIdentifier:
1515
name: CLONE
16-
DEFAULT_COOLDOWN: 1
17-
COOLDOWN: 1
16+
DEFAULT_COOLDOWN: 10
17+
COOLDOWN: 10
1818
DURATION: 0.1
19+
_clone_is_alive: 0
1920
particles: {fileID: 1680149101079458943, guid: 4fc65d1314c914f4398fdd4b0338d383, type: 3}
2021
clone: {fileID: 6625813557290402506, guid: 15941104a927a2b45b342f3abdcc8ef9, type: 3}
22+
clone_offset: 2.5
23+
duration: 0.25
24+
clone_controller: {fileID: 0}

Assets/Scripts/Asteroids/AsteroidLogic.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,15 @@ private void OnTriggerEnter2D(Collider2D other)
4242
Instantiate(hit_particles, transform.position, Quaternion.identity);
4343
PlayerMovement.Instance.health.current_healthpoints -= DAMAGE;
4444
}
45+
46+
if (other.CompareTag("Clone"))
47+
{
48+
PlayerMovement.Instance.ability_holder.ability._clone_is_alive = false;
49+
50+
Destroy(gameObject);
51+
Destroy(other.gameObject);
52+
Instantiate(hit_particles, other.gameObject.transform.position, Quaternion.identity);
53+
}
4554
}
4655
private void CalculateCameraBounds()
4756
{

Assets/Scripts/Bosses/Projectieles/BossProjectile1.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
public class BossProjectile1 : MonoBehaviour
44
{
55
[SerializeField] float PROJECTILE_SPEED;
6+
[SerializeField] ParticleSystem hit_particles;
67
[SerializeField] int DAMAGE;
78
Vector2 _move_direction;
89

@@ -17,11 +18,24 @@ private void OnTriggerEnter2D(Collider2D other)
1718
{
1819
Destroy(gameObject);
1920
PlayerMovement.Instance.health.current_healthpoints -= DAMAGE;
21+
SpawnParticles(hit_particles, transform.position);
22+
}
23+
24+
if (other.CompareTag("Clone"))
25+
{
26+
Destroy(other.gameObject);
27+
PlayerMovement.Instance.ability_holder.ability._clone_is_alive = false;
28+
SpawnParticles(hit_particles, other.transform.position);
2029
}
2130
}
2231

2332
public void SetDirection(Vector2 _move_direction)
2433
{
2534
this._move_direction = _move_direction.normalized;
2635
}
36+
37+
public void SpawnParticles(ParticleSystem particle, Vector2 pos)
38+
{
39+
Instantiate(particle, pos, Quaternion.identity);
40+
}
2741
}

Assets/Scripts/Bosses/Projectieles/BossProjectile2.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class BossProjectile2 : MonoBehaviour
77
[SerializeField] float MOVEMENT_SPEED;
88
[SerializeField] float MAX_LIFE_TIME;
99
[SerializeField] float MIN_LIFE_TIME;
10+
[SerializeField] ParticleSystem hit_particles;
1011

1112
Vector2 _movement_direction;
1213
float _life_time;
@@ -64,6 +65,20 @@ private void OnTriggerEnter2D(Collider2D other)
6465
Detonate();
6566
PlayerMovement.Instance.knock_back.CallKnockBack(_movement_direction, Vector2.zero, new Vector2(Input.GetAxis("Horizontal"), Input.GetAxisRaw("Vertical")));
6667
PlayerMovement.Instance.health.current_healthpoints -= DAMAGE;
68+
SpawnParticles(hit_particles, other.transform.position);
6769
}
70+
71+
if (other.CompareTag("Clone"))
72+
{
73+
Destroy(other.gameObject);
74+
Detonate();
75+
PlayerMovement.Instance.ability_holder.ability._clone_is_alive = false;
76+
SpawnParticles(hit_particles, other.transform.position);
77+
}
78+
}
79+
80+
public void SpawnParticles(ParticleSystem particle, Vector2 pos)
81+
{
82+
Instantiate(particle, pos, Quaternion.identity);
6883
}
6984
}

Assets/Scripts/Bosses/Projectieles/BossProjectile3.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public class BossProjectile3 : MonoBehaviour
66
[SerializeField] float MOVEMENT_SPEED;
77
[SerializeField] float MAX_LIFE_TIME;
88
[SerializeField] float MIN_LIFE_TIME;
9+
[SerializeField] ParticleSystem hit_particles;
910

1011
float _life_time;
1112
Vector2 _movement_direction;
@@ -68,11 +69,25 @@ private void OnTriggerEnter2D(Collider2D other)
6869
Detonate();
6970
PlayerMovement.Instance.knock_back.CallKnockBack(attackDirection, Vector2.zero, new Vector2(Input.GetAxis("Horizontal"), Input.GetAxisRaw("Vertical")));
7071
PlayerMovement.Instance.health.current_healthpoints--;
72+
SpawnParticles(hit_particles, other.transform.position);
73+
}
74+
75+
if (other.CompareTag("Clone"))
76+
{
77+
Destroy(other.gameObject);
78+
Detonate();
79+
PlayerMovement.Instance.ability_holder.ability._clone_is_alive = false;
80+
SpawnParticles(hit_particles, other.transform.position);
7181
}
7282
}
7383

7484
public void SetDirection(Vector2 _movement_direction)
7585
{
7686
this._movement_direction = _movement_direction.normalized;
7787
}
88+
89+
public void SpawnParticles(ParticleSystem particle, Vector2 pos)
90+
{
91+
Instantiate(particle, pos, Quaternion.identity);
92+
}
7893
}

Assets/Scripts/Bosses/logic/BossLogic.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ public class BossLogic : MonoBehaviour
77
[SerializeField] public int MAX_HEALTHPOINTS;
88
[SerializeField] int COLLISION_DAMAGE;
99
[SerializeField] int SCORE;
10+
[SerializeField] ParticleSystem hit_particles;
1011
[SerializeField] public ParticleSystem spawn_particles;
1112
static int _currentHealthpoints { get; set; }
1213
Vector2 _attack_direction;
@@ -48,6 +49,14 @@ private void OnTriggerEnter2D(Collider2D other)
4849
{
4950
PlayerMovement.Instance.health.current_healthpoints -= COLLISION_DAMAGE;
5051
PlayerMovement.Instance.knock_back.CallKnockBack(_attack_direction, Vector2.zero, new Vector2(Input.GetAxisRaw("Horizontal"), Input.GetAxisRaw("Vertical")));
52+
Instantiate(hit_particles, other.transform.position, Quaternion.identity);
53+
}
54+
55+
if (other.CompareTag("Clone"))
56+
{
57+
Destroy(other.gameObject);
58+
PlayerMovement.Instance.ability_holder.ability._clone_is_alive = false;
59+
Instantiate(hit_particles, other.transform.position, Quaternion.identity);
5160
}
5261
}
5362

Assets/Scripts/Collectables/SpawnCoin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void Start()
1212

1313
private void OnTriggerEnter2D(Collider2D other)
1414
{
15-
if (other.CompareTag("Player"))
15+
if (other.CompareTag("Player") || other.CompareTag("Clone"))
1616
{
1717
Instantiate(COLLECT_PARTICLES, other.transform.position, Quaternion.identity);
1818
PlayerMovement.Instance.score.UpdateScorePoints(SCORE_VALUE);

Assets/Scripts/Collectables/SpawnItem.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ void Start()
1414

1515
private void OnTriggerEnter2D(Collider2D other)
1616
{
17-
if (other.CompareTag("Player"))
17+
if (other.CompareTag("Player") || other.CompareTag("Clone"))
1818
{
1919
Instantiate(COLLECT_PARTICLES, transform.position, Quaternion.identity);
2020
ItemLogic.Instance.UpdateSprite(_sprite, index);

0 commit comments

Comments
 (0)