Skip to content

Commit

Permalink
Implement turret (#96)
Browse files Browse the repository at this point in the history
* Implement turret

* Improve bullet trail accuracy

* Linter fixes

* Register enemy collision on stay
  • Loading branch information
12joan authored Dec 28, 2024
1 parent d280ee6 commit fe1f669
Show file tree
Hide file tree
Showing 29 changed files with 2,030 additions and 374 deletions.
42 changes: 39 additions & 3 deletions Assets/Resources/Bullets/GenericBullet.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ GameObject:
- component: {fileID: 2888045085230147104}
- component: {fileID: 6818582875802437754}
- component: {fileID: 8838713438586547750}
m_Layer: 10
m_Layer: 7
m_Name: GenericBullet
m_TagString: Untagged
m_Icon: {fileID: 0}
Expand All @@ -31,13 +31,13 @@ Transform:
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8934373914239993322}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0.05, y: 0.05, z: 0.05}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &8722506420512878562
SpriteRenderer:
Expand Down Expand Up @@ -108,6 +108,12 @@ Rigidbody2D:
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: 1
Expand Down Expand Up @@ -138,6 +144,25 @@ CircleCollider2D:
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: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
Expand All @@ -157,6 +182,8 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
BulletData: {fileID: 6818582875802437754}
Rigidbody: {fileID: 8884931971228052092}
Collider: {fileID: 8876649700796538210}
Explosion: {fileID: 7389867378484595371, guid: 134940c82002c43e9a8a278851098395,
type: 3}
--- !u!114 &2888045085230147104
Expand Down Expand Up @@ -186,9 +213,13 @@ MonoBehaviour:
m_EditorClassIdentifier:
Damage: 0
Lifetime: 10
Originator: {fileID: 0}
CounterAttackSpeed: 0
CounterAttackDamage: 0
IgnoreCollider: {fileID: 0}
--- !u!96 &8838713438586547750
TrailRenderer:
serializedVersion: 2
serializedVersion: 3
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
Expand Down Expand Up @@ -229,6 +260,7 @@ TrailRenderer:
m_SortingLayer: 3
m_SortingOrder: 4
m_Time: 0.1
m_PreviewTimeScale: 1
m_Parameters:
serializedVersion: 3
widthMultiplier: 1
Expand Down Expand Up @@ -283,14 +315,18 @@ TrailRenderer:
atime6: 0
atime7: 0
m_Mode: 1
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
numCornerVertices: 0
numCapVertices: 0
alignment: 0
textureMode: 0
textureScale: {x: 1, y: 1}
shadowBias: 0
generateLightingData: 0
m_MinVertexDistance: 0.1
m_MaskInteraction: 0
m_Autodestruct: 0
m_Emitting: 1
m_ApplyActiveColorSpace: 0
35 changes: 22 additions & 13 deletions Assets/Resources/Bullets/Player Bullet.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 8934373914239993322, guid: d851732923cc64201b6cdb6c0c5701cd,
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_Name
value: GenericBullet
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
Expand All @@ -29,27 +30,22 @@ PrefabInstance:
objectReference: {fileID: 0}
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_LocalRotation.x
value: 0
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_LocalRotation.y
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_LocalRotation.z
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_RootOrder
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8930779186304927626, guid: d851732923cc64201b6cdb6c0c5701cd,
Expand All @@ -67,5 +63,18 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8934373914239993322, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_Name
value: Player Bullet
objectReference: {fileID: 0}
- target: {fileID: 8934373914239993322, guid: d851732923cc64201b6cdb6c0c5701cd,
type: 3}
propertyPath: m_Layer
value: 10
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d851732923cc64201b6cdb6c0c5701cd, type: 3}
19 changes: 19 additions & 0 deletions Assets/Unity/Prefabs/Explosion - Bullet.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,29 @@ PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 3054406881209703319, guid: 9a75ea4552b8c43029b9cf003f9ec909,
type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3054406881209703319, guid: 9a75ea4552b8c43029b9cf003f9ec909,
type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3054406881209703319, guid: 9a75ea4552b8c43029b9cf003f9ec909,
type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3054406881209703319, guid: 9a75ea4552b8c43029b9cf003f9ec909,
type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3054406881209703319, guid: 9a75ea4552b8c43029b9cf003f9ec909,
type: 3}
propertyPath: m_LocalPosition.x
Expand Down Expand Up @@ -68,4 +84,7 @@ PrefabInstance:
value: Explosion - Bullet
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 9a75ea4552b8c43029b9cf003f9ec909, type: 3}
12 changes: 11 additions & 1 deletion Assets/Unity/Prefabs/Fire Bullet.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 1537304828578118174}
- component: {fileID: 1449753731771774517}
m_Layer: 16
m_Layer: 0
m_Name: Fire Bullet
m_TagString: Untagged
m_Icon: {fileID: 0}
Expand Down Expand Up @@ -109,6 +109,16 @@ PrefabInstance:
propertyPath: EventReference.Path
value: event:/SFX/Shoot
objectReference: {fileID: 0}
- target: {fileID: 3895571317138567579, guid: d44c370bc297b42ecb0bac5ebaf34dc8,
type: 3}
propertyPath: OverrideMaxDistance
value: 20
objectReference: {fileID: 0}
- target: {fileID: 3895571317138567579, guid: d44c370bc297b42ecb0bac5ebaf34dc8,
type: 3}
propertyPath: OverrideMinDistance
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3895571317138567579, guid: d44c370bc297b42ecb0bac5ebaf34dc8,
type: 3}
propertyPath: EventReference.Guid.Data1
Expand Down
6 changes: 1 addition & 5 deletions Assets/Unity/Prefabs/Fire Bullets.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ GameObject:
m_Component:
- component: {fileID: 7114263429249187202}
- component: {fileID: 139334188211178207}
m_Layer: 16
m_Layer: 0
m_Name: Fire Bullets
m_TagString: Untagged
m_Icon: {fileID: 0}
Expand Down Expand Up @@ -46,15 +46,11 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
FireBullet: {fileID: 1398586588733534333}
Duration: -1
BulletsPerSecond: 1
BulletPrefab: {fileID: 0}
BulletSpeed: 0
BulletDamage: 0
ShootSoundKey:
OnStopFiring:
m_PersistentCalls:
m_Calls: []
--- !u!1001 &537696650250667592
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down
2 changes: 1 addition & 1 deletion Assets/Unity/Prefabs/Main Camera.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ Camera:
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 7864119
m_Bits: 7864247
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
Expand Down
Loading

0 comments on commit fe1f669

Please sign in to comment.