Skip to content

Commit

Permalink
Everything before Enemies Push
Browse files Browse the repository at this point in the history
Now starts the fun part
  • Loading branch information
aps16104 committed Apr 14, 2020
1 parent 1fdc606 commit adbc1b8
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Platformer/Assets/Scripts/Player_Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ public class Player_Controller : MonoBehaviour
public float speed = 7.5f; //speed
public Rigidbody2D rb; //Rigidbody

public int health = 100;
private int maxhealth = 100;
public int cash;

int jumps; //Amount of jumps available
int maxjumps = 2; //Max amount of Jumps (Double Jump)
float jumpforce = 7.75f; //Force going up (Y axis)
Expand Down Expand Up @@ -70,7 +74,13 @@ void OnTriggerEnter2D(Collider2D other) //Pickups
if (other.gameObject.CompareTag("Cash"))
{
other.gameObject.SetActive(false); // cash dissapears
//Add money
cash = cash + 1; //Add money
}

if (other.gameObject.CompareTag("Heart"))
{
other.gameObject.SetActive(false); // heart dissapears
health = maxhealth; // Full Health
}

}
Expand Down
179 changes: 179 additions & 0 deletions Platformer/Assets/_Scenes/Level1.unity
Original file line number Diff line number Diff line change
Expand Up @@ -114921,9 +114921,106 @@ Transform:
- {fileID: 2040197220}
- {fileID: 681257127}
- {fileID: 1193376037}
- {fileID: 1655925709}
m_Father: {fileID: 1250005596}
m_RootOrder: 20
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1472312206
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1472312207}
- component: {fileID: 1472312208}
- component: {fileID: 1472312209}
m_Layer: 0
m_Name: Heart
m_TagString: Heart
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1472312207
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1472312206}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 26.45, y: 0.44, z: 0}
m_LocalScale: {x: 1.5, y: 1.5, z: 1}
m_Children: []
m_Father: {fileID: 2065312515}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1472312208
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1472312206}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
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_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: -1143351675
m_SortingLayer: 3
m_SortingOrder: 0
m_Sprite: {fileID: 21300000, guid: 07816604be5be104ba2d0abfbece5e70, 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.64, y: 0.64}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!58 &1472312209
CircleCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1472312206}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 1
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: 0.003745397, y: 0.0149811115}
serializedVersion: 2
m_Radius: 0.15146191
--- !u!1 &1494321885
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -115443,6 +115540,85 @@ BoxCollider2D:
serializedVersion: 2
m_Size: {x: 2.1570625, y: 0.29268646}
m_EdgeRadius: 0
--- !u!1 &1655925708
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1655925709}
- component: {fileID: 1655925711}
- component: {fileID: 1655925710}
m_Layer: 0
m_Name: _Bottom
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1655925709
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1655925708}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 4.39, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 1403593694}
m_RootOrder: 38
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!50 &1655925710
Rigidbody2D:
serializedVersion: 4
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1655925708}
m_BodyType: 2
m_Simulated: 1
m_UseFullKinematicContacts: 0
m_UseAutoMass: 0
m_Mass: 1
m_LinearDrag: 0
m_AngularDrag: 0.05
m_GravityScale: 1
m_Material: {fileID: 0}
m_Interpolate: 0
m_SleepingMode: 1
m_CollisionDetection: 0
m_Constraints: 0
--- !u!61 &1655925711
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1655925708}
m_Enabled: 1
m_Density: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_UsedByComposite: 0
m_Offset: {x: -26.439413, y: 1.6464424}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0}
oldSize: {x: 0, y: 0}
newSize: {x: 0, y: 0}
adaptiveTilingThreshold: 0
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
serializedVersion: 2
m_Size: {x: 49.879, y: 3.1187325}
m_EdgeRadius: 0
--- !u!1 &1667615512
GameObject:
m_ObjectHideFlags: 0
Expand Down Expand Up @@ -116497,6 +116673,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
speed: 7.5
rb: {fileID: 1919620929}
health: 100
cash: 0
door: {fileID: 697734696}
--- !u!212 &1919620927
SpriteRenderer:
Expand Down Expand Up @@ -116892,6 +117070,7 @@ Transform:
- {fileID: 399541328}
- {fileID: 697734697}
- {fileID: 850308271}
- {fileID: 1472312207}
m_Father: {fileID: 0}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
Expand Down
1 change: 1 addition & 0 deletions Platformer/ProjectSettings/TagManager.asset
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ TagManager:
- Box
- Key
- Cash
- Heart
layers:
- Default
- TransparentFX
Expand Down

0 comments on commit adbc1b8

Please sign in to comment.