Example #1
0
    protected override void Awake()
    {
        base.Awake();

        _name          = "Planète Twippie";
        _planetManager = PlanetManager.Instance;
        _planetManager.Add(this);
        _vertexManager  = GetComponent <VertexManager>();
        _twippieManager = TwippieManager.Instance;
    }
Example #2
0
        public void LoadPlanets()
        {
            // Earth
            Planet earth = new Planet();

            earth.name             = "Earth";
            earth.radius           = 200;
            earth.sprite.texture   = Content.Load <Texture2D>("PlasmaBalls");
            earth.sprite.position  = new Vector2(300, 300);
            earth.sprite.scale     = new Vector2(earthScale, earthScale);
            earth.sprite.rotation  = 0f;
            earth.sprite.rectangle = new Rectangle(0, 0, (earth.sprite.texture.Width / 13), earth.sprite.texture.Height / 4);
            earth.sprite.origin    = new Vector2((earth.sprite.texture.Width / 13) / 2, (earth.sprite.texture.Height / 4) / 2);
            planetManager.Add(earth);

            // Saturn
            Planet saturn = new Planet();

            saturn.name             = "Saturn";
            saturn.radius           = 300;
            saturn.sprite.texture   = Content.Load <Texture2D>("PlasmaBalls");
            saturn.sprite.position  = new Vector2(300, 300);
            saturn.sprite.scale     = new Vector2(saturnScale, saturnScale);
            saturn.sprite.rotation  = 0f;
            saturn.sprite.rectangle = new Rectangle(0, 0, (saturn.sprite.texture.Width / 13), saturn.sprite.texture.Height / 4);
            saturn.sprite.origin    = new Vector2((saturn.sprite.texture.Width / 13) / 2, (saturn.sprite.texture.Height / 4) / 2);
            planetManager.Add(saturn);

            // Pluto
            Planet pluto = new Planet();

            pluto.name             = "Pluto";
            pluto.radius           = 400;
            pluto.sprite.texture   = Content.Load <Texture2D>("PlasmaBalls");
            pluto.sprite.position  = new Vector2(400, 400);
            pluto.sprite.scale     = new Vector2(plutoScale, plutoScale);
            pluto.sprite.rotation  = 0f;
            pluto.sprite.rectangle = new Rectangle(0, 0, (pluto.sprite.texture.Width / 13), pluto.sprite.texture.Height / 4);
            pluto.sprite.origin    = new Vector2((pluto.sprite.texture.Width / 13) / 2, (pluto.sprite.texture.Height / 4) / 2);
            planetManager.Add(pluto);
        }
Example #3
0
 private void OnEnable()
 {
     PlanetManager.Add(this);
 }