mirror of
https://github.com/ConjureETS/PixelSphinx.git
synced 2026-03-24 02:20:58 +00:00
corrections de bogues d'intégration
This commit is contained in:
parent
4d6094b40f
commit
6c11a27e46
@ -7,21 +7,21 @@ public class Asteroid : MonoBehaviour
|
|||||||
public float speed;
|
public float speed;
|
||||||
public float step;
|
public float step;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
speed = Random.Range(0.9F, 3F);
|
speed = Random.Range(0.9F, 3F);
|
||||||
// print(speed);
|
// print(speed);
|
||||||
center = new Vector3(0, 0);
|
center = new Vector3(0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
public void Update () {
|
||||||
MoveObject(center);
|
MoveObject(center);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MoveObject(Vector3 center)
|
public void MoveObject(Vector3 center)
|
||||||
{
|
{
|
||||||
step = speed * Time.deltaTime;
|
step = speed * Time.deltaTime;
|
||||||
this.transform.position = Vector3.MoveTowards(transform.position, center, step);
|
this.transform.position = Vector3.MoveTowards(transform.position, center, step);
|
||||||
|
|||||||
@ -62,8 +62,8 @@ public class Astronaut : MonoBehaviour {
|
|||||||
private float walkTime = 0;
|
private float walkTime = 0;
|
||||||
private int nextStep = 1;
|
private int nextStep = 1;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
public void Start () {
|
||||||
if (!planet)
|
if (!planet)
|
||||||
{
|
{
|
||||||
planet = FindObjectOfType<PlanetManager>();
|
planet = FindObjectOfType<PlanetManager>();
|
||||||
@ -103,9 +103,9 @@ public class Astronaut : MonoBehaviour {
|
|||||||
{
|
{
|
||||||
return Mathf.Repeat(num + limit, limit);
|
return Mathf.Repeat(num + limit, limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
public void Update () {
|
||||||
float delta = Time.deltaTime;
|
float delta = Time.deltaTime;
|
||||||
|
|
||||||
if (!grounded)
|
if (!grounded)
|
||||||
|
|||||||
@ -9,8 +9,8 @@ public class AstronautController : MonoBehaviour {
|
|||||||
|
|
||||||
public int PlayerNumber;
|
public int PlayerNumber;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber);
|
InputManager.Instance.PushActiveContext("Gameplay", PlayerNumber);
|
||||||
InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis);
|
InputManager.Instance.AddCallback(PlayerNumber, HandlePlayerAxis);
|
||||||
|
|||||||
@ -6,33 +6,33 @@ public class Earthquake : MonoBehaviour {
|
|||||||
const int gaugeMax=100;
|
const int gaugeMax=100;
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
gaugeLevel = 0;
|
gaugeLevel = 0;
|
||||||
InvokeRepeating("FillGauge", 1, 1F);
|
InvokeRepeating("FillGauge", 1, 1F);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
public void Update () {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Actualiser l'affichage de la gauge
|
/// Actualiser l'affichage de la gauge
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void UpdateFixed()
|
public void UpdateFixed()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// à être Appelé à chaque fois qu'on enfonce un plateau, le gage se remplis plus vite. (et par le temps)
|
/// à être Appelé à chaque fois qu'on enfonce un plateau, le gage se remplis plus vite. (et par le temps)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FillGauge()
|
public void FillGauge()
|
||||||
{
|
{
|
||||||
if (gaugeLevel < gaugeMax)
|
if (gaugeLevel < gaugeMax)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -10,6 +10,7 @@ public class PlanetManager : MonoBehaviour
|
|||||||
public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360
|
public float TailleCartiersEnDegres = 0; //radian -> valeurs 0 a 360
|
||||||
public float CartierResetRatioSpeedFactor = 0.23f; //Entre 0.05 et 1 ou plus on aime que ca restore lentement, randomnly
|
public float CartierResetRatioSpeedFactor = 0.23f; //Entre 0.05 et 1 ou plus on aime que ca restore lentement, randomnly
|
||||||
public bool CartierResetRatioSpeedRandomize = true;
|
public bool CartierResetRatioSpeedRandomize = true;
|
||||||
|
public bool CartierResetOverTime = true;
|
||||||
public float CartierMinRatio = 0.4f;
|
public float CartierMinRatio = 0.4f;
|
||||||
public float CartierMaxRatio = 2.0f;
|
public float CartierMaxRatio = 2.0f;
|
||||||
public float CartierStepSize = 0.25f;
|
public float CartierStepSize = 0.25f;
|
||||||
@ -17,7 +18,7 @@ public class PlanetManager : MonoBehaviour
|
|||||||
public List<Wedge> wedges = new List<Wedge>();
|
public List<Wedge> wedges = new List<Wedge>();
|
||||||
|
|
||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Awake () {
|
public void Awake () {
|
||||||
TailleCartiersEnDegres = 360.0f / NbCartiers;
|
TailleCartiersEnDegres = 360.0f / NbCartiers;
|
||||||
|
|
||||||
for(int i = 0; i < NbCartiers; i++)
|
for(int i = 0; i < NbCartiers; i++)
|
||||||
@ -34,17 +35,17 @@ public class PlanetManager : MonoBehaviour
|
|||||||
w.sprite = GameObject.Find(obj.name);
|
w.sprite = GameObject.Find(obj.name);
|
||||||
wedges.Add(w); //pushes at end.
|
wedges.Add(w); //pushes at end.
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update () {
|
public void Update () {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FixedUpdate()
|
public void FixedUpdate()
|
||||||
{
|
{
|
||||||
if (!this.CartierResetRatioSpeedRandomize) return;
|
if (!this.CartierResetOverTime) return;
|
||||||
//Ramener les plateforme vers leur position initiale 0;
|
//Ramener les plateforme vers leur position initiale 0;
|
||||||
|
|
||||||
foreach (var w in wedges)
|
foreach (var w in wedges)
|
||||||
@ -88,7 +89,7 @@ public class PlanetManager : MonoBehaviour
|
|||||||
|
|
||||||
w.offset = w.offset - CartierStepSize;
|
w.offset = w.offset - CartierStepSize;
|
||||||
if (w.offset < CartierMinRatio)
|
if (w.offset < CartierMinRatio)
|
||||||
w.offset = 0.5f;
|
w.offset = CartierMinRatio;
|
||||||
|
|
||||||
|
|
||||||
w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1);
|
w.sprite.transform.localScale = new Vector3(w.offset, w.offset, 1);
|
||||||
@ -99,7 +100,7 @@ public class PlanetManager : MonoBehaviour
|
|||||||
|
|
||||||
v.offset = v.offset + CartierStepSize;
|
v.offset = v.offset + CartierStepSize;
|
||||||
if (v.offset > CartierMaxRatio)
|
if (v.offset > CartierMaxRatio)
|
||||||
v.offset = 1.5f;
|
v.offset = CartierMaxRatio;
|
||||||
|
|
||||||
v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1);
|
v.sprite.transform.localScale = new Vector3(v.offset, v.offset, 1);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ public class testRotate : MonoBehaviour {
|
|||||||
private float speed = 33.2f;
|
private float speed = 33.2f;
|
||||||
public bool check;
|
public bool check;
|
||||||
|
|
||||||
void Update()
|
public void Update()
|
||||||
{
|
{
|
||||||
if(Input.GetKeyDown("space") || Input.GetKey("s"))
|
if(Input.GetKeyDown("space") || Input.GetKey("s"))
|
||||||
{
|
{
|
||||||
@ -41,18 +41,18 @@ public class testRotate : MonoBehaviour {
|
|||||||
// Use this for initialization
|
// Use this for initialization
|
||||||
void Start () {
|
void Start () {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Juste pour tester le mouvement du player autour du cercle.
|
/// Juste pour tester le mouvement du player autour du cercle.
|
||||||
/// Le player se déplace de gauche a droite en x et la valeur de x représente l'angle theta
|
/// Le player se déplace de gauche a droite en x et la valeur de x représente l'angle theta
|
||||||
/// saute en y
|
/// saute en y
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void FixedUpdate()
|
public void FixedUpdate()
|
||||||
{
|
{
|
||||||
|
|
||||||
var theta = Time.realtimeSinceStartup * speed % 360.0f; // Position X du player = angle theta
|
var theta = Time.realtimeSinceStartup * speed % 360.0f; // Position X du player = angle theta
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user