From 5abd249ad7a6657b769816288dbef60af09bb357 Mon Sep 17 00:00:00 2001 From: Kaj Forney Date: Sat, 8 Oct 2022 21:00:31 -0600 Subject: [PATCH] Add box obstacle prefab. --- Assets/Prefabs/obstacleBox.prefab | 113 +++++++++++++++++++ Assets/Prefabs/obstacleBox.prefab.meta | 7 ++ Assets/Scripts/GroundCheck.cs | 4 +- Assets/Scripts/Tetromino.cs | 2 +- Assets/Sprites/obstacleBox.png | Bin 0 -> 191 bytes Assets/Sprites/obstacleBox.png.meta | 147 +++++++++++++++++++++++++ 6 files changed, 270 insertions(+), 3 deletions(-) create mode 100644 Assets/Prefabs/obstacleBox.prefab create mode 100644 Assets/Prefabs/obstacleBox.prefab.meta create mode 100644 Assets/Sprites/obstacleBox.png create mode 100644 Assets/Sprites/obstacleBox.png.meta diff --git a/Assets/Prefabs/obstacleBox.prefab b/Assets/Prefabs/obstacleBox.prefab new file mode 100644 index 0000000..71cb49d --- /dev/null +++ b/Assets/Prefabs/obstacleBox.prefab @@ -0,0 +1,113 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &3224938504399037949 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 119941788420280649} + - component: {fileID: 7647140970045164102} + - component: {fileID: 8892586399279781962} + m_Layer: 3 + m_Name: obstacleBox + m_TagString: Platform + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &119941788420280649 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3224938504399037949} + 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: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!212 &7647140970045164102 +SpriteRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3224938504399037949} + 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: 68f689bc890304c3696b49eb321d28b5, type: 3} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_FlipX: 0 + m_FlipY: 0 + m_DrawMode: 0 + m_Size: {x: 0.32, y: 0.32} + m_AdaptiveModeThreshold: 0.5 + m_SpriteTileMode: 0 + m_WasSpriteAssigned: 1 + m_MaskInteraction: 0 + m_SpriteSortPoint: 0 +--- !u!61 &8892586399279781962 +BoxCollider2D: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3224938504399037949} + m_Enabled: 1 + m_Density: 1 + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_UsedByEffector: 0 + m_UsedByComposite: 0 + m_Offset: {x: 0, y: 0} + m_SpriteTilingProperty: + border: {x: 0, y: 0, z: 0, w: 0} + pivot: {x: 0.5, y: 0.5} + oldSize: {x: 2, y: 2} + newSize: {x: 0.32, y: 0.32} + adaptiveTilingThreshold: 0.5 + drawMode: 0 + adaptiveTiling: 0 + m_AutoTiling: 0 + serializedVersion: 2 + m_Size: {x: 2, y: 2} + m_EdgeRadius: 0 diff --git a/Assets/Prefabs/obstacleBox.prefab.meta b/Assets/Prefabs/obstacleBox.prefab.meta new file mode 100644 index 0000000..82fc71f --- /dev/null +++ b/Assets/Prefabs/obstacleBox.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: f3ef60b295b52753fb0ea8a0e5a416ef +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/GroundCheck.cs b/Assets/Scripts/GroundCheck.cs index b776678..8d3575e 100644 --- a/Assets/Scripts/GroundCheck.cs +++ b/Assets/Scripts/GroundCheck.cs @@ -14,7 +14,7 @@ public class GroundCheck : MonoBehaviour { if (collision.collider.CompareTag("Ground") || collision.collider.CompareTag("Platform") || collision.collider.CompareTag("Tetromino")) { - Debug.Log("Now standing on "+ collision.collider.name); + //Debug.Log("Now standing on "+ collision.collider.name); player.GetComponent().isGrounded = true; } } @@ -25,7 +25,7 @@ public class GroundCheck : MonoBehaviour { if (GetComponent().IsTouchingLayers(solidLayer) == false) { - Debug.Log("No longer standing on " + collision.collider.name); + //Debug.Log("No longer standing on " + collision.collider.name); player.GetComponent().isGrounded = false; } } diff --git a/Assets/Scripts/Tetromino.cs b/Assets/Scripts/Tetromino.cs index 226a720..f67582d 100644 --- a/Assets/Scripts/Tetromino.cs +++ b/Assets/Scripts/Tetromino.cs @@ -104,7 +104,7 @@ public class Tetromino : MonoBehaviour { Debug.Log("Collided with object: " + collision.collider.name); //We hit something, but we only want to collide with the ground or other tetrominoes. - if (collision.collider.CompareTag("Ground") || collision.collider.CompareTag("Tetromino")) + if (collision.collider.CompareTag("Ground") || collision.collider.CompareTag("Tetromino") || collision.collider.CompareTag("Platform")) { ScoreCounter.scoreAmount += 100; return true; diff --git a/Assets/Sprites/obstacleBox.png b/Assets/Sprites/obstacleBox.png new file mode 100644 index 0000000000000000000000000000000000000000..a082069691116e33013a486a50469d56f9139187 GIT binary patch literal 191 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz#^NA%Cx&(BWL^R}m7Xq+ArY;~ zIx*Wm*dJzKTE>05pKr-u9vvPa5Z@-BYEk?{Bv#iiQ#&OA1QxAc8^OTcbMWKWmkkyP zA6gFZ=e=YsJn(?C@uG>rEH<~x2Qs82e3=(#CYbQ{EQ1Q>NF|i?_)2fMx3O{g*8^<_ dTHm@$GPGS+aqc)~G6(1g22WQ%mvv4FO#lTELw*1N literal 0 HcmV?d00001 diff --git a/Assets/Sprites/obstacleBox.png.meta b/Assets/Sprites/obstacleBox.png.meta new file mode 100644 index 0000000..0c33439 --- /dev/null +++ b/Assets/Sprites/obstacleBox.png.meta @@ -0,0 +1,147 @@ +fileFormatVersion: 2 +guid: 68f689bc890304c3696b49eb321d28b5 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 12 + 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 + vTOnly: 0 + ignoreMasterTextureLimit: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 0 + aniso: 1 + mipBias: 0 + 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: 16 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 1 + spriteTessellationDetail: -1 + textureType: 8 + textureShape: 1 + singleChannelComponent: 0 + flipbookRows: 1 + flipbookColumns: 1 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + ignorePngGamma: 0 + applyGammaDecoding: 0 + cookieLightType: 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: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: Server + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + - serializedVersion: 3 + buildTarget: iPhone + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + 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: 1 + 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: [] + nameFileIdTable: {} + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: