Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Ronan-senpi/Mix-Jam-2020 in…
Browse files Browse the repository at this point in the history
…to main
  • Loading branch information
Ronan-senpi committed Nov 15, 2020
2 parents a853826 + 935ecbe commit 92b46cb
Show file tree
Hide file tree
Showing 7 changed files with 124 additions and 5 deletions.
106 changes: 106 additions & 0 deletions Assets/Scenes/Scene1.unity
Original file line number Diff line number Diff line change
Expand Up @@ -604,6 +604,102 @@ GameObject:
type: 3}
m_PrefabInstance: {fileID: 4370738345167158660}
m_PrefabAsset: {fileID: 0}
--- !u!82 &1697364593
AudioSource:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1697364587}
m_Enabled: 1
serializedVersion: 4
OutputAudioMixerGroup: {fileID: 0}
m_audioClip: {fileID: 8300000, guid: 218e454c50406fb4189f4f13471cf981, type: 3}
m_PlayOnAwake: 0
m_Volume: 1
m_Pitch: 1
Loop: 0
Mute: 0
Spatialize: 0
SpatializePostEffects: 0
Priority: 128
DopplerLevel: 1
MinDistance: 1
MaxDistance: 500
Pan2D: 0
rolloffMode: 0
BypassEffects: 0
BypassListenerEffects: 0
BypassReverbZones: 0
rolloffCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
- serializedVersion: 3
time: 1
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
panLevelCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
spreadCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 0
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
reverbZoneMixCustomCurve:
serializedVersion: 2
m_Curve:
- serializedVersion: 3
time: 0
value: 1
inSlope: 0
outSlope: 0
tangentMode: 0
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2
m_PostInfinity: 2
m_RotationOrder: 4
--- !u!4 &1851246681 stripped
Transform:
m_CorrespondingSourceObject: {fileID: 3320924135295365722, guid: f08527ae00e09c847aebb171f1fa81b3,
Expand Down Expand Up @@ -1305,6 +1401,16 @@ PrefabInstance:
propertyPath: deathMenu
value:
objectReference: {fileID: 1697364587}
- target: {fileID: 5177300201713391517, guid: ef1080b9418e11948bc8a7c9402f7431,
type: 3}
propertyPath: m_audioClip
value:
objectReference: {fileID: 8300000, guid: 3242de36a8dcf3a499845bca958326b5, type: 3}
- target: {fileID: 5177300201713391517, guid: ef1080b9418e11948bc8a7c9402f7431,
type: 3}
propertyPath: m_PlayOnAwake
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7903293172621304627, guid: ef1080b9418e11948bc8a7c9402f7431,
type: 3}
propertyPath: m_Name
Expand Down
4 changes: 4 additions & 0 deletions Assets/Scenes/Scripts/Menu/DeathMenu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@ public class DeathMenu : MonoBehaviour

public bool on;
// Start is called before the first frame update

private AudioSource audio;
void Start()
{
on = false;
audio = this.GetComponent<AudioSource>();
}

// Update is called once per frame
Expand All @@ -24,6 +27,7 @@ void Update()
if(on == true)
{
//FERMER L UI PRINCIPAL POUR LAISSER L UI DEATH
audio.Play();
}

}
Expand Down
4 changes: 3 additions & 1 deletion Assets/Scenes/Scripts/SpaceShip/PV.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ public class PV : MonoBehaviour
// DEATHMENU
public GameObject deathMenu;


private AudioSource audio;
private void Start()
{
isDead = false;
audio = this.GetComponent<AudioSource>();
}
// Update is called once per frame
void Update()
Expand All @@ -27,6 +28,7 @@ private void OnCollisionEnter2D(Collision2D collision)
{
if(pv > 0)
{
audio.Play();
pv = pv - 1;
Destroy(collision.gameObject);
}
Expand Down
4 changes: 2 additions & 2 deletions Assets/Scenes/Scripts/Spawner/Spawner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ void Update()
Instantiate(gameObjectInstantiate[randEnemy], spawnPoint[randSpawnPoint].position, transform.rotation);
difficultTimer = difficultTimer - 0.05f;
timer = difficultTimer;
if(difficultTimer <=0.5f)
if(difficultTimer <=0.2f)
{
difficultTimer = 0.5f;
difficultTimer = 0.2f;
timer = difficultTimer;
}
}
Expand Down
5 changes: 4 additions & 1 deletion Assets/Scripts/Food/TakeFood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ public class TakeFood : MonoBehaviour
{
[SerializeField]
LayerMask hitMask;

private AudioSource audio;
private void Start()
{

audio = this.GetComponent<AudioSource>();
}
private void OnCollisionEnter2D(Collision2D collision)
{
Expand All @@ -17,6 +19,7 @@ private void OnCollisionEnter2D(Collision2D collision)
Food food;
if (collision.transform.TryGetComponent(out food))
{
audio.Play();
FoodManager.Instance.AddFood(food);
Destroy(collision.transform.gameObject);
}
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Monster/MonsterDeplacement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void Update()
}
else if (targetFood)
{
if(Vector2.Distance(transform.position,targetFood.position)< 5)
if(Vector2.Distance(transform.position,targetFood.position)< 10)
{
transform.position = Vector2.MoveTowards(transform.position, targetFood.position, speed * Time.deltaTime);
Vector3 direction = targetFood.position - transform.position;
Expand Down
4 changes: 4 additions & 0 deletions Assets/Scripts/Monster/MonsterFood.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,14 @@ public class MonsterFood : MonoBehaviour
{
public MonsterDeplacement monsterState;
public int monsterIntState;

private AudioSource audio;
// Start is called before the first frame update
void Start()
{
monsterState =this.gameObject.GetComponent<MonsterDeplacement>();
monsterIntState = monsterState.state;
audio = this.GetComponent<AudioSource>();
}

// Update is called once per frame
Expand All @@ -23,6 +26,7 @@ private void OnCollisionEnter2D(Collision2D collision)
{
if(collision.gameObject.tag =="Food")
{
audio.Play();
monsterIntState = monsterIntState + 1;
monsterState.state = monsterIntState;
Destroy(collision.gameObject);
Expand Down

0 comments on commit 92b46cb

Please sign in to comment.