Skip to content

Commit

Permalink
Bug Fixes
Browse files Browse the repository at this point in the history
-Fixed bug where bird would not register being collided
-Fixed bug where the bird can be shot from any distance
-Fixed bug in level 2 where the level name is missmatched
  • Loading branch information
JdomiDev committed Sep 22, 2022
1 parent 21480a8 commit 2ee14ec
Show file tree
Hide file tree
Showing 10 changed files with 1,885 additions and 102 deletions.
Binary file modified .vs/AngryBirds/v16/.suo
Binary file not shown.
265 changes: 265 additions & 0 deletions Assets/Scenes/Level2.unity
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,121 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 468370828}
m_PrefabAsset: {fileID: 0}
--- !u!1 &483957091
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 483957096}
- component: {fileID: 483957095}
- component: {fileID: 483957094}
- component: {fileID: 483957093}
- component: {fileID: 483957092}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &483957092
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 483957091}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 88e3c61bf39ff37419a54d393beaa563, type: 3}
m_Name:
m_EditorClassIdentifier:
fpsText: {fileID: 1238719741}
--- !u!114 &483957093
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 483957091}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &483957094
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 483957091}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!223 &483957095
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 483957091}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 25
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &483957096
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 483957091}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1238719743}
m_Father: {fileID: 0}
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1001 &499868238
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -720,6 +835,141 @@ Transform:
type: 3}
m_PrefabInstance: {fileID: 1206975692}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1238719740
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1238719743}
- component: {fileID: 1238719742}
- component: {fileID: 1238719741}
m_Layer: 5
m_Name: Text (TMP)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1238719741
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1238719740}
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: 36
m_fontSizeBase: 36
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: 0, w: 0}
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 &1238719742
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1238719740}
m_CullTransparentMesh: 1
--- !u!224 &1238719743
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1238719740}
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: 483957096}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 22.800049, y: 0}
m_SizeDelta: {x: 200, y: 50}
m_Pivot: {x: 0, y: 0}
--- !u!1001 &1371202492
PrefabInstance:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -877,6 +1127,11 @@ PrefabInstance:
propertyPath: m_Name
value: Ground (1)
objectReference: {fileID: 0}
- target: {fileID: 1847638850294291891, guid: 5e1a46301ed0c1d429e090ae46f9e01d,
type: 3}
propertyPath: m_TagString
value: Ground
objectReference: {fileID: 0}
- target: {fileID: 1847638850294291894, guid: 5e1a46301ed0c1d429e090ae46f9e01d,
type: 3}
propertyPath: m_RootOrder
Expand Down Expand Up @@ -1239,6 +1494,11 @@ PrefabInstance:
propertyPath: m_Name
value: Ground
objectReference: {fileID: 0}
- target: {fileID: 1847638850294291891, guid: 5e1a46301ed0c1d429e090ae46f9e01d,
type: 3}
propertyPath: m_TagString
value: Ground
objectReference: {fileID: 0}
- target: {fileID: 1847638850294291894, guid: 5e1a46301ed0c1d429e090ae46f9e01d,
type: 3}
propertyPath: m_RootOrder
Expand Down Expand Up @@ -1995,6 +2255,11 @@ PrefabInstance:
propertyPath: m_LocalPosition.y
value: -8.465
objectReference: {fileID: 0}
- target: {fileID: 4855354791349431617, guid: c7ffc95f7de8f644caa907bf313adcb8,
type: 3}
propertyPath: m_text
value: 1 - 2
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c7ffc95f7de8f644caa907bf313adcb8, type: 3}
--- !u!1001 &5321178195635266788
Expand Down
3 changes: 2 additions & 1 deletion Assets/Scripts/SlingShot.cs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ private void Update()
}
BirdToThrow.transform.position = maxPosition;
}

else
{
if(BirdWaitPosition.transform.position.x - BirdToThrow.transform.position.x <= 0.3f && BirdWaitPosition.transform.position.x - BirdToThrow.transform.position.x >= -0.3f)
Expand All @@ -194,7 +195,7 @@ private void Update()

float distance = Vector3.Distance(SlingshotMiddleVector, BirdToThrow.transform.position);

if (distance > 0.5f)
if (distance > 0.75f)
{
audio.PlayOneShot(shootClips[UnityEngine.Random.Range(0, 3)], 0.5f);

Expand Down
42 changes: 42 additions & 0 deletions Assets/Scripts/StatsCounter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using System;

public class StatsCounter : MonoBehaviour
{

[SerializeField] TextMeshProUGUI fpsText;

// Start is called before the first frame update
void Start()
{
fpsText.enabled = false;
}

// Update is called once per frame
void Update()
{
if(Input.GetKeyDown(KeyCode.N))
{
changeState();
}
if(fpsText.enabled == true)
{
fpsText.text = (1f / Time.unscaledDeltaTime).ToString();
}
}

void changeState()
{
if(fpsText.enabled == true)
{
fpsText.enabled = false;
}
else
{
fpsText.enabled = true;
}
}
}
11 changes: 11 additions & 0 deletions Assets/Scripts/StatsCounter.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2ee14ec

Please sign in to comment.