mirror of
https://github.com/ConjureETS/Labo_2_Equ_1_a15.git
synced 2026-03-24 01:50:58 +00:00
Pick up hearts
This commit is contained in:
parent
222f6e6d37
commit
a904cf25ab
Binary file not shown.
@ -1,6 +1,6 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 304af85f492026f499d09ceb6768bd22
|
||||
timeCreated: 1446164889
|
||||
guid: f0e4eaefb315ab44d801e3e38218f47c
|
||||
timeCreated: 1447952927
|
||||
licenseType: Free
|
||||
DefaultImporter:
|
||||
userData:
|
||||
|
||||
@ -17,8 +17,8 @@ public class Health : MonoBehaviour
|
||||
|
||||
void Start ()
|
||||
{
|
||||
spaceX = 2.3f;
|
||||
spaceY = 2.3f;
|
||||
spaceX = 1.2f;
|
||||
spaceY = 1.2f;
|
||||
|
||||
AddHearts (startingHealth);
|
||||
}
|
||||
@ -69,4 +69,13 @@ public class Health : MonoBehaviour
|
||||
LoseHearts(1);
|
||||
}
|
||||
}
|
||||
|
||||
void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
if( other.gameObject.tag == "HeartPickUp" )
|
||||
{
|
||||
AddHearts(1);
|
||||
Destroy (other.gameObject);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user