From c2f573f66c4715c6302738c6c67826a1639d1306 Mon Sep 17 00:00:00 2001 From: teascade Date: Thu, 15 Aug 2019 00:58:24 +0300 Subject: [PATCH] Update particles, Add Rockets and stuff --- Assets/Graphics/Effects/Particle.mat | 98 + Assets/Graphics/Effects/Particle.mat.meta | 8 + Assets/Graphics/Effects/Particle.png | Bin 0 -> 248 bytes Assets/Graphics/Effects/Particle.png.meta | 115 + Assets/Graphics/Effects/Rocket.png | Bin 0 -> 461 bytes Assets/Graphics/Effects/Rocket.png.meta | 115 + Assets/Graphics/Entities/Bazooka.png | Bin 0 -> 720 bytes Assets/Graphics/Entities/Bazooka.png.meta | 115 + Assets/Prefabs/Bullets/RevolverBullet.prefab | 19 +- Assets/Prefabs/Bullets/Rocket.prefab | 9694 +++++++++++++++++ Assets/Prefabs/Bullets/Rocket.prefab.meta | 7 + Assets/Prefabs/Guns/Revolver.prefab | 3 +- Assets/Prefabs/Guns/Rocket Launcher.prefab | 262 + .../Prefabs/Guns/Rocket Launcher.prefab.meta | 7 + Assets/Scenes/MainScene.unity | 76 + Assets/Scripts/Guns/Bullet.cs | 22 + Assets/Scripts/Guns/Gun.cs | 17 +- Assets/Scripts/Guns/RevolverBullet.cs | 26 +- Assets/Scripts/Guns/Rocket.cs | 76 + Assets/Scripts/Guns/Rocket.cs.meta | 11 + ProjectSettings/Physics2DSettings.asset | 2 +- ProjectSettings/TagManager.asset | 2 +- Raw Assets/Bazooka.xcf | Bin 0 -> 1930 bytes Raw Assets/CrabEnemy.xcf | Bin 5806 -> 5806 bytes Raw Assets/Particle.xcf | Bin 0 -> 1505 bytes Raw Assets/Rocket.xcf | Bin 0 -> 1518 bytes 26 files changed, 10643 insertions(+), 32 deletions(-) create mode 100644 Assets/Graphics/Effects/Particle.mat create mode 100644 Assets/Graphics/Effects/Particle.mat.meta create mode 100644 Assets/Graphics/Effects/Particle.png create mode 100644 Assets/Graphics/Effects/Particle.png.meta create mode 100644 Assets/Graphics/Effects/Rocket.png create mode 100644 Assets/Graphics/Effects/Rocket.png.meta create mode 100644 Assets/Graphics/Entities/Bazooka.png create mode 100644 Assets/Graphics/Entities/Bazooka.png.meta create mode 100644 Assets/Prefabs/Bullets/Rocket.prefab create mode 100644 Assets/Prefabs/Bullets/Rocket.prefab.meta create mode 100644 Assets/Prefabs/Guns/Rocket Launcher.prefab create mode 100644 Assets/Prefabs/Guns/Rocket Launcher.prefab.meta create mode 100644 Assets/Scripts/Guns/Rocket.cs create mode 100644 Assets/Scripts/Guns/Rocket.cs.meta create mode 100644 Raw Assets/Bazooka.xcf create mode 100644 Raw Assets/Particle.xcf create mode 100644 Raw Assets/Rocket.xcf diff --git a/Assets/Graphics/Effects/Particle.mat b/Assets/Graphics/Effects/Particle.mat new file mode 100644 index 0000000..654d6c7 --- /dev/null +++ b/Assets/Graphics/Effects/Particle.mat @@ -0,0 +1,98 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Particle + m_Shader: {fileID: 211, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: _ALPHABLEND_ON + m_LightmapFlags: 0 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - ALWAYS + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 0bff8cefb2c5bdc488d3b16a8bdc5159, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BlendOp: 0 + - _BumpScale: 1 + - _CameraFadingEnabled: 0 + - _CameraFarFadeDistance: 2 + - _CameraNearFadeDistance: 1 + - _ColorMode: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DistortionBlend: 0.5 + - _DistortionEnabled: 0 + - _DistortionStrength: 1 + - _DistortionStrengthScaled: 0 + - _DstBlend: 10 + - _EmissionEnabled: 0 + - _FlipbookMode: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _LightingEnabled: 0 + - _Metallic: 0 + - _Mode: 2 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SoftParticlesEnabled: 0 + - _SoftParticlesFarFadeDistance: 1 + - _SoftParticlesNearFadeDistance: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _UVSec: 0 + - _ZWrite: 0 + m_Colors: + - _CameraFadeParams: {r: 0, g: Infinity, b: 0, a: 0} + - _Color: {r: 2, g: 2, b: 2, a: 1} + - _ColorAddSubDiff: {r: 0, g: 0, b: 0, a: 0} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SoftParticleFadeParams: {r: 0, g: 0, b: 0, a: 0} diff --git a/Assets/Graphics/Effects/Particle.mat.meta b/Assets/Graphics/Effects/Particle.mat.meta new file mode 100644 index 0000000..f84506f --- /dev/null +++ b/Assets/Graphics/Effects/Particle.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f8c4002dba4187d44a0150e452228fe3 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Graphics/Effects/Particle.png b/Assets/Graphics/Effects/Particle.png new file mode 100644 index 0000000000000000000000000000000000000000..5a5e27efdf3a758a1e6db87f85f0a855e3087b44 GIT binary patch literal 248 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkEbHUgGKN%Kn&xPn1vBSL(eSP)M@GHKN2hKQ}iuuY|$5C^fMpHASI3 zvm`^o-P1Q9ypc~Fs3^hH#WBR<^x0rXz5@z8lm7ibUtyGZw&#J~<3*f72d^2{aZl=D z?aQcMCM;4C_x(qbEQ409G(*Ljmv6my1kBn#na@l6_}a@H>Kk_jZ!Z(S^3W{n{Z{Lk j<11^lW&XBni|eV)O)lSE-YO^pw2Q&h)z4*}Q$iB}yp>Nc literal 0 HcmV?d00001 diff --git a/Assets/Graphics/Effects/Particle.png.meta b/Assets/Graphics/Effects/Particle.png.meta new file mode 100644 index 0000000..3b04d2a --- /dev/null +++ b/Assets/Graphics/Effects/Particle.png.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: 0bff8cefb2c5bdc488d3b16a8bdc5159 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Graphics/Effects/Rocket.png b/Assets/Graphics/Effects/Rocket.png new file mode 100644 index 0000000000000000000000000000000000000000..802ed3695701522ce6ce6354b20fe25663f13bf4 GIT binary patch literal 461 zcmV;;0W$uHP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00A{gL_t(2&z+L7Y63wJhQAqa z_f8ayT#@3$Qj)?q5o`{8mwO1GNALx#tOBtQ1Y%*M#esJ_Db&+oAee!Lg`N54-`T>Nv&;Z1ib5U&yn%f_J=t_RwLH)5qUg8N?RM?9IBISpq-jdO-)A

zXKv&d(=N>-C!Da%q47Xah(R;y6Y`$g&I(!Fx|#*MtxNP*uj`F?pU}=5_^` z2*=|Q5kW*yRaBKYj`7~3s)z_lk}w*Lm`o-B)_g$@2h0rT93g~8@@@B~nHg18{hUEv zmOS@*cgYtJKv|aTc00D)EsMnhK(2tn0QH`5PIS&uRTa)TRFx0{`~9BPYQ<)=;WET4 zpwpoh0u?Zy&;MGz-1*?6-EMYW6h-S{H=eEh@@U~V$7Fd`P)Yi_00000NkvXXu0mjf D%GtV% literal 0 HcmV?d00001 diff --git a/Assets/Graphics/Effects/Rocket.png.meta b/Assets/Graphics/Effects/Rocket.png.meta new file mode 100644 index 0000000..5018104 --- /dev/null +++ b/Assets/Graphics/Effects/Rocket.png.meta @@ -0,0 +1,115 @@ +fileFormatVersion: 2 +guid: 6481b0fdf28b45f48becd6f76c2e70bc +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 10 + 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: 0 + 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: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Standalone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: WebGL + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 0 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: 5e97eb03825dee720800000000000000 + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Graphics/Entities/Bazooka.png b/Assets/Graphics/Entities/Bazooka.png new file mode 100644 index 0000000000000000000000000000000000000000..77bda1dda442c4e7e880143419cef2fae3e7143d GIT binary patch literal 720 zcmV;>0x$iEP)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00KBkL_t(o!|jwiZreZ*hCeP> zq#htGQGsLw2@Iq&RJ+k#+~@?pj9WE1fDhopjk}bA3PY6vfyzTR0|kLdk-M8h;aY-| zSOJWr;n(fX?94y2n1PClii(Q=jPobscszCi7f^sZ8jaR3nEMuZ>x{=^@8aSjYc`uG zr3k~2G)-|`mnez|f`H|6Nx$Fc=H>=~EX#Hx6-BXg?smJ>>vfb;D5dPZ@B8F=&SJ4( zI-R1m*3S9)xj8vGK}xx4iSyVLtu^cQrszD+0jSk#_O7I~0SF-o!w?|^#u$t-Hm>71 z7-LA1gzM{TuCA_--ENm8N$@<6Mx%k}c~*oF0^j$odH`dL4emG&QcCN;ExtT!t*sEH z6jDkK4h|R&hfF3D#Qps}olb`^4Do&cNs#Tp+Z`z}#-O#fK4qfvUTaNJ6cj~)*4lo{ zVzFSgS|KklFNx!r!C-(8g2Tf@Tm5$8?N+8~x+B7MT`M9<9%wdO+}+*LZnx?6dSqE< z-)pVubUGMga9wvZ1wjy)e!owi=Num&+rKu(kmor^M@ML_iQ|~nYV|~bloE77uT{fc zFZooon1B94qtPIWq8YJtF7zpYBc<{Uc@lp%TmyfH>?6KtjsssCC03qOZ4$}v| z{YwE}!-MZBOk$Wm>{tDZa&}7is$O=#qN1W=e|`Y`=?hB7OG#q@0000(); + Health Health = Collider.GetComponent(); + VendingMachine VendingMachine = Collider.GetComponent(); + if (Health != null) { + Health.Damage(Damage, -Direction, true); + } else if (VendingMachine != null) { + VendingMachine.ExpelGun(); + } else if (Explodable != null) { + Explodable.Explode(true); + } else if (Collider.tag == "Environment") { + BloodLauncher.DebrisExplode(transform.position, Direction, (int)(5 * Intensity), 30 * Intensity, 360); + } + if (Collider.attachedRigidbody != null && Collider.attachedRigidbody.bodyType == RigidbodyType2D.Dynamic) { + Collider.attachedRigidbody.AddForce(Direction * 4 * Intensity, ForceMode2D.Impulse); + } + } } } diff --git a/Assets/Scripts/Guns/Gun.cs b/Assets/Scripts/Guns/Gun.cs index 8ca079d..eaaf61d 100644 --- a/Assets/Scripts/Guns/Gun.cs +++ b/Assets/Scripts/Guns/Gun.cs @@ -10,16 +10,26 @@ namespace Saltosion.OneWeapon.Guns { public Bullet Bullet; public SpriteRenderer Sprite; public Transform BulletHole; - public float Cooldown = 0.5f; + public float MaxCooldown = 0.5f; + public float MinCooldown = 0.2f; public Bobbing Bobbing; private bool IsHeld = false; private float CurrCooldown = 0; + private Bullet CurrentBullet; + private bool HasShotBullet = false; + void Update() { if (CurrCooldown > 0) { CurrCooldown -= Time.deltaTime; } + + if (HasShotBullet && (CurrentBullet.HasExploded || CurrentBullet == null)) { + CurrCooldown = Mathf.Min(CurrCooldown, MinCooldown); + CurrentBullet = null; + HasShotBullet = false; + } } void OnCollisionEnter2D(Collision2D collision) { @@ -41,10 +51,13 @@ namespace Saltosion.OneWeapon.Guns { Debug.LogError("THERE IS NO BULLET"); } else { if (CurrCooldown <= 0) { - CurrCooldown = Cooldown; + CurrCooldown = MaxCooldown; Bullet ShotBullet = Instantiate(Bullet, BulletHole.position, new Quaternion()); ShotBullet.Direction = direction.normalized; ShotBullet.InitialRotation = rotation; + + CurrentBullet = ShotBullet; + HasShotBullet = true; return true; } } diff --git a/Assets/Scripts/Guns/RevolverBullet.cs b/Assets/Scripts/Guns/RevolverBullet.cs index d0f6316..66d8b6d 100644 --- a/Assets/Scripts/Guns/RevolverBullet.cs +++ b/Assets/Scripts/Guns/RevolverBullet.cs @@ -18,9 +18,12 @@ namespace Saltosion.OneWeapon.Guns { private float DeathTimer = 0; + private Bullet Bullet; + void Start() { - Vector2 Direction = GetComponent().Direction; - float Rot = GetComponent().InitialRotation; + Bullet = GetComponent(); + Vector2 Direction = Bullet.Direction; + float Rot = Bullet.InitialRotation; Body.velocity = Direction * 15; Body.rotation = Rot - 90; @@ -40,6 +43,8 @@ namespace Saltosion.OneWeapon.Guns { // don't hit the player! return; } + Bullet.HasExploded = true; + Destroy(Sprite); Destroy(Body); Destroy(GetComponent()); @@ -48,22 +53,7 @@ namespace Saltosion.OneWeapon.Guns { DeathTimer = 19; // Do damage here, kill everyone - Explodable Explodable = collider.GetComponent(); - Health Health = collider.GetComponent(); - VendingMachine VendingMachine = collider.GetComponent(); - Vector2 Direction = (collider.transform.position - transform.position).normalized; - if (Health != null) { - Health.Damage(12f, -Direction, true); - } else if (VendingMachine != null) { - VendingMachine.ExpelGun(); - } else if (Explodable != null) { - Explodable.Explode(true); - } else if (collider.tag == "Environment") { - BloodLauncher.DebrisExplode(transform.position, Body.velocity.normalized * 0.7f, 5, 30f, 360); - } - if (collider.attachedRigidbody != null && collider.attachedRigidbody.bodyType == RigidbodyType2D.Dynamic) { - collider.attachedRigidbody.AddForce(Direction * 4f, ForceMode2D.Impulse); - } + Bullet.DoDamage(12, 1, collider, Bullet.Direction); } } } diff --git a/Assets/Scripts/Guns/Rocket.cs b/Assets/Scripts/Guns/Rocket.cs new file mode 100644 index 0000000..9bd31d9 --- /dev/null +++ b/Assets/Scripts/Guns/Rocket.cs @@ -0,0 +1,76 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using Saltosion.OneWeapon.Player; +using Saltosion.OneWeapon.Enemies; +using Saltosion.OneWeapon.Effects; +using Saltosion.OneWeapon.Environment; + +namespace Saltosion.OneWeapon.Guns { + [RequireComponent(typeof(Bullet))] + public class Rocket : MonoBehaviour { + + public Rigidbody2D Body; + public GameObject Sprite; + + public ParticleSystem Trail; + public ParticleSystem Explosion; + + [Range(0, 10)] + public float ExplodeRadius; + + private float DeathTimer = 0; + + private Bullet Bullet; + + void Start() { + Bullet = GetComponent(); + + Vector2 Direction = Bullet.Direction; + float Rot = Bullet.InitialRotation; + + Body.velocity = Direction * 8; + Body.rotation = Rot - 90; + + Explosion.Stop(); + } + + void Update() { + DeathTimer += Time.deltaTime; + if (DeathTimer > 20) { + Destroy(gameObject); + } + } + + void OnTriggerEnter2D(Collider2D collider) { + if (collider.GetComponent() != null) { + // don't hit the player! + return; + } + Bullet.HasExploded = true; + + Destroy(Sprite); + Destroy(Body); + Destroy(GetComponent()); + Explosion.Play(); + Trail.Stop(); + DeathTimer = 19; + + Collider2D[] NearbyColliders = Physics2D.OverlapCircleAll(transform.position, ExplodeRadius); + + foreach (Collider2D curr in NearbyColliders) { + Vector2 dir = (curr.transform.position - transform.position); + float ScaledDistance = 1 - Mathf.Clamp((dir.magnitude - (ExplodeRadius / 3)) / (ExplodeRadius - (ExplodeRadius / 3)), 0, 1); + Bullet.DoDamage(ScaledDistance * 20, ScaledDistance * 2, curr, dir.normalized); + } + + // Do damage here, kill everyone + + } + + private void OnDrawGizmosSelected() { + Gizmos.color = new Color(1.0f, 0.2f, 0.2f, 0.8f); + Gizmos.DrawWireSphere(transform.position, ExplodeRadius); + } + } +} diff --git a/Assets/Scripts/Guns/Rocket.cs.meta b/Assets/Scripts/Guns/Rocket.cs.meta new file mode 100644 index 0000000..9c65770 --- /dev/null +++ b/Assets/Scripts/Guns/Rocket.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c5e880551cb08a545a50b0ce1c0afe01 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/ProjectSettings/Physics2DSettings.asset b/ProjectSettings/Physics2DSettings.asset index 80f8ddf..ddff895 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: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffffefffffff7fffffffbffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff + m_LayerCollisionMatrix: fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffdfffffff6fffffff7fffffff9ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 075d8bb..2a9ad4b 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -19,7 +19,7 @@ TagManager: - Bullet - Blood - Bloodphobic - - + - Walls - - - diff --git a/Raw Assets/Bazooka.xcf b/Raw Assets/Bazooka.xcf new file mode 100644 index 0000000000000000000000000000000000000000..9c010531507cb03674a6a91e642d6f9732d08063 GIT binary patch literal 1930 zcmdT^OHUI~6h1RkrckKzP^3oFi_+Mp4z!Zd_$D;*ftV1ZMuM{_WjZ!O+jQ!K#8`}) z7>PzSwn96z^MAN;t~aOglb#-3X5iKsUrUC0(>r>%L6n{oYdj9v}5mJ*q%DK(wPInXBU zv78#us}t;6Du0O`KY4nDDy^$aQ&VwGm9$)Hf^xW;gP@+Do>ZBhnM_TDJi(-v$V_H( zEVvq^oHib3k>1EE))7&=6vEc=bz19n_Gdw@*Y#{XkxFYUy0^ZeCpf)c(#}a&(y2U4 zr4yG_o%%D$q^{n|o4&Cg~^g+;`1TV6#H=?HJ)!{}#HQGO5YYfms z+CpI5>Cp8LPQaW4{42+Vp(fhTMY}G9{4 z-aeUod~0^{#^c%h_wUVTeBkZzA2|{mJbeD_fv6DTq~+MLzD|FX4^;!QPXL!*1=DPR zk4j|h!ho{BJ22eiZG{h8&iIvs7e`MkI)L5*OKqSGUK|}(x?s6W85|o6_~2`oa%v>7 z6;`@NluZS$1^z!fmZb3B$nN#*kbQFhPWgu&O}!iBZh22ww(Sr>4#@ps8SU_(lH1V^ zj~tdd&<>9zH~zzR%>4Q5Sdv1$EWE~!W>~Hn;e!?W{RQqWp0x%mf+&dXP<``N+-_Ob z0?gpwZoAb4oX`LkFIbl71FHdJ3q}#6w-&d8)xulb;M)d^j6yJ*q?-rhiOX6pb0s}N x)4$z5wB~=ged;$Vy)(i+REw)4!;xrTFYYAjIv5Hf!hN$A0SYd7jeLQ8{vGHi$shm# literal 0 HcmV?d00001 diff --git a/Raw Assets/CrabEnemy.xcf b/Raw Assets/CrabEnemy.xcf index d0954c0615e30918bde8a361d204254c9f0cbae4..4829d6c18ae355f4164ef40c5d0b65f70a32755f 100644 GIT binary patch delta 70 zcmZ3dyH0n46QlG-=ORW%>&e>~^(H5ZDoo~K+QWEq@<}FX&bJI;AgVw4Et5DWFNDXx TZ8I-(h|uIGj2fF8MRgeg#|sj7 delta 87 zcmZ3dyH0n46Qkrt=ORWJU;|Gv$v%ppRPpD-$HZWPsJ1OSB86R7|I diff --git a/Raw Assets/Particle.xcf b/Raw Assets/Particle.xcf new file mode 100644 index 0000000000000000000000000000000000000000..dda07d0e184135b15f13728d2add8d6afd617be3 GIT binary patch literal 1505 zcmdT@%Wl&^6rFMGCOGuPYf-Tn9<9|%n}-8dVMWm>{#)a1r?E~8Qo#7k8kh@Gdq z&ndD}rK)k1$ZnFW0ddIYtW%VekrYKXQiIK~Gfd)al;xsRnQor!N20gYt7H!7o6sgo z_ve(_xcEJw(v#vSidCA3{v+Ek>`dm7hU*@usuU`X4`f00*>G6Ma<)NGlV7Qtxmrr+ z;0XUzJB>FE3Fv=wd^`MP)Bg(j#%jUT#WtBzOzQ?%u?L4^D!OfeOA@9)GTX0+OrQ5&!@I literal 0 HcmV?d00001 diff --git a/Raw Assets/Rocket.xcf b/Raw Assets/Rocket.xcf new file mode 100644 index 0000000000000000000000000000000000000000..432b84568e71173b69dab5cc1c5cc42e4518f38b GIT binary patch literal 1518 zcmdT^O>fgc5FLLc(AX&{1*8H8Q$TVKsgesDWh#SQ3zQhq96hS&=Eu|bC ztY`T33@>E3mf=cypso}N^qDA8~)Rt*Y6Jo_a*p|44uI1hkh`K zyd4paldsL5ABr)H#Q3ldkPOW@jN%Zb<7gY_2XZV#=u>vQh=?P>wTA3d}hQqZ?eF;Wa=jB;lgrCc^@~6?Z2&Z{Z z;`JpsS`TOCWjLwyLlwsO-tpSMD?G;Ey{gbl3rnCf5sFNJWqkDw1aZ