Trousse est maintenant fonctionnel

elle rend 3 pv
This commit is contained in:
JoelLapointe86 2015-12-01 21:04:07 -05:00
parent 354821e715
commit b4cc1dc6ce
9 changed files with 50 additions and 26 deletions

View File

@ -14,7 +14,7 @@ GameObject:
- 114: {fileID: 11431192}
- 95: {fileID: 9512508}
- 114: {fileID: 11482776}
m_Layer: 0
m_Layer: 9
m_Name: Enemy
m_TagString: Enemy
m_Icon: {fileID: 0}
@ -152,6 +152,10 @@ Prefab:
propertyPath: maxHP
value: 2
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Layer
value: 9
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}
m_RootGameObject: {fileID: 183722}

View File

@ -10,7 +10,6 @@ GameObject:
- 4: {fileID: 412680}
- 50: {fileID: 5021002}
- 114: {fileID: 11417938}
- 61: {fileID: 6160456}
- 58: {fileID: 5858278}
- 212: {fileID: 21297412}
m_Layer: 0
@ -60,20 +59,7 @@ CircleCollider2D:
m_UsedByEffector: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Radius: 4
--- !u!61 &6160456
BoxCollider2D:
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 100100000}
m_GameObject: {fileID: 172872}
m_Enabled: 1
m_Material: {fileID: 0}
m_IsTrigger: 0
m_UsedByEffector: 0
m_Offset: {x: 0, y: 0}
serializedVersion: 2
m_Size: {x: 3.66000009, y: 4.5999999}
m_Radius: 2.25
--- !u!114 &11417938
MonoBehaviour:
m_ObjectHideFlags: 1
@ -85,8 +71,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: b50c00a886c5b1a4196e8364e365416a, type: 3}
m_Name:
m_EditorClassIdentifier:
bombRadius: 10
bombForce: 100
bombRadius: .5
fuseTime: 1.5
explosion: {fileID: 100000, guid: 340a9e7d5164c9c4fba1dc34dc50b866, type: 2}
--- !u!212 &21297412
@ -128,7 +113,15 @@ Prefab:
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Radius
value: 4
value: 2.25
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 0}
propertyPath: bombRadius
value: .5
objectReference: {fileID: 0}
m_RemovedComponents: []
m_ParentPrefab: {fileID: 0}

View File

@ -924,7 +924,6 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
audioPickup: {fileID: 8300000, guid: a48a7087d05490f4b913e6cd1d177494, type: 3}
health: {fileID: 1113329686}
--- !u!61 &1736051096
BoxCollider2D:
m_ObjectHideFlags: 0

View File

@ -3,9 +3,7 @@ using System.Collections;
public class Bomb : MonoBehaviour
{
public float bombRadius = 10f; // Radius within which enemies are killed.
public float bombForce = 100f; // Force that enemies are thrown from the blast.
public float bombRadius = 0.5f; // Radius within which enemies are killed.
public float fuseTime = 1.5f;
public GameObject explosion; // Prefab of explosion effect.

View File

@ -4,6 +4,7 @@ using UnityEngine.UI;
public class CollisionCheck : MonoBehaviour {
//[HideInInspector]
public Text health;
@ -19,11 +20,24 @@ public class CollisionCheck : MonoBehaviour {
health.text = "Health: " + gameObject.GetComponent<Health>().removeHP(1);
}
if(gameObject.GetComponent<Health>().getHP() == 0)
{
gameObject.GetComponent<PlayerBehavior>().Death();
}
}
void OnTriggerEnter2D(Collider2D col)
{
if(col.tag == "Player")
{
health.text = "Health: " + gameObject.GetComponent<Health>().addHP(3);
}
}
}

View File

@ -9,17 +9,18 @@ public class HealthPickup : MonoBehaviour
public AudioClip audioPickup;
public Text health;
void OnTriggerEnter2D(Collider2D other)
{
if(other.tag == "Player")
{
AudioSource.PlayClipAtPoint(audioPickup, transform.position);
health.text = "Health: " + other.gameObject.GetComponent<Health>().addHP(3);
// Destroy the crate.
Destroy(gameObject);
//heal player
health.text = "Health: " + gameObject.GetComponent<Health>().addHP(3);
}

View File

@ -5,6 +5,7 @@ public class LayBombs : MonoBehaviour
{
[HideInInspector]
public bool bombLaid = false; // si une bombe a été lancé
[HideInInspector]
public int bombCount = 0; // nombre bomb que le joueur possede
public GameObject bomb; // Prefab of the bomb.

View File

@ -8,6 +8,7 @@ PlayerSettings:
defaultScreenOrientation: 4
targetDevice: 2
targetResolution: 0
useOnDemandResources: 0
accelerometerFrequency: 60
companyName: DefaultCompany
productName: Laboratoire_2_Equipe_2
@ -28,6 +29,7 @@ PlayerSettings:
androidShowActivityIndicatorOnLoading: -1
iosAppInBackgroundBehavior: 0
displayResolutionDialog: 1
iosAllowHTTPDownload: 1
allowedAutorotateToPortrait: 1
allowedAutorotateToPortraitUpsideDown: 1
allowedAutorotateToLandscapeRight: 1
@ -135,6 +137,15 @@ PlayerSettings:
iOSLaunchScreenFillPct: 100
iOSLaunchScreenSize: 100
iOSLaunchScreenCustomXibPath:
iOSLaunchScreeniPadType: 0
iOSLaunchScreeniPadImage: {fileID: 0}
iOSLaunchScreeniPadBackgroundColor:
serializedVersion: 2
rgba: 0
iOSLaunchScreeniPadFillPct: 100
iOSLaunchScreeniPadSize: 100
iOSLaunchScreeniPadCustomXibPath:
iOSDeviceRequirements: []
AndroidTargetDevice: 0
AndroidSplashScreenScale: 0
androidSplashScreen: {fileID: 0}
@ -224,6 +235,8 @@ PlayerSettings:
ps4SdkOverride:
ps4BGMPath:
ps4ShareFilePath:
ps4ShareOverlayImagePath:
ps4PrivacyGuardImagePath:
ps4NPtitleDatPath:
ps4RemotePlayKeyAssignment: -1
ps4RemotePlayKeyMappingDir:
@ -245,6 +258,7 @@ PlayerSettings:
ps4attribMoveSupport: 0
ps4attrib3DSupport: 0
ps4attribShareSupport: 0
ps4IncludedModules: []
monoEnv:
psp2Splashimage: {fileID: 0}
psp2NPTrophyPackPath:

View File

@ -16,7 +16,7 @@ TagManager:
-
-
- Ground
-
- Enemies
-
-
-