Esempio n. 1
0
    void OnSceneGUI()
    {
        MeteorsManager managerMeteors = (MeteorsManager)target;

        Handles.color = Color.white;
        Handles.DrawWireArc(Vector3.zero, Vector3.forward, Vector3.up, 360f, managerMeteors.radiusSpawn);
    }
Esempio n. 2
0
 void Awake()
 {
     if (instance != null)
     {
         Debug.LogError("More than one MeteorsManager in scene !"); return;
     }
     instance = this;
 }
Esempio n. 3
0
    public void Init(MeteorsManager mm)
    {
        this.mm = mm;

        body     = GetComponent <Rigidbody2D>();
        animator = GetComponent <Animator>();

        torque = Random.Range(-10, 10);

        body.AddTorque(torque);
        body.AddForce(direction * force, ForceMode2D.Force);
    }
        ActionScene(
            Game game, Texture2D theTexture, Texture2D backgroundTexture, SpriteFont font, Vector2 gameoverPosition)
            : base(game)
        {
            this._audio = (AudioLibrary)Game.Services.GetService(typeof(AudioLibrary));
            this._background = new ImageComponent(game, backgroundTexture, ImageComponent.DrawMode.Stretch);
            Components.Add(this._background);
            this._actionTexture = theTexture;
            this._spriteBatch = (SpriteBatch)Game.Services.GetService(typeof(SpriteBatch));
            this._meteors = new MeteorsManager(Game, ref this._actionTexture);
            Components.Add(this._meteors);
            this._scoreFont = font;
            this._gameoverPosition = gameoverPosition;
            this._scorePlayer1 = new Score(game, font, Color.Blue) { Position = new Vector2(10, 10) };
            Components.Add(this._scorePlayer1);

            this._rumblePad = new SimpleRumblePad(game);
            Components.Add(this._rumblePad);
            this._powerSource = new PowerSource(game, ref this._actionTexture);
            Components.Add(this._powerSource);
            #if DEBUG
            this._positionDebugText = new TextComponent(game, this._scoreFont, new Vector2(), Color.Red);
            Components.Add(this._positionDebugText);
            #endif
        }
Esempio n. 5
0
        ActionScene(Game game, Texture2D theTexture, Texture2D backgroundTexture, SpriteFont font)
            : base(game)
        {
            _audio = (AudioLibrary)Game.Services.GetService(typeof(AudioLibrary));
            _background = new ImageComponent(game, backgroundTexture, ImageComponent.DrawMode.Stretch);
            Components.Add(_background);

            _actionTexture = theTexture;

            _spriteBatch = (SpriteBatch) Game.Services.GetService(typeof (SpriteBatch));
            _meteors = new MeteorsManager(Game, ref _actionTexture);
            Components.Add(_meteors);

            _scoreFont = font;

            _scorePlayer1 = new Score(game, font, _player1FontColor) {Position = new Vector2(10, 10)};
            Components.Add(_scorePlayer1);

            _rumblePad = new SimpleRumblePad(game);
            Components.Add(_rumblePad);

            _powerSource = new PowerSource(game, ref _actionTexture);
            _powerSource.Initialize();
            Components.Add(_powerSource);

            _wrench = new Wrench(game, game.Content.Load<Texture2D>("wrench"));
            _wrench.Initialize();
            Components.Add(_wrench);

            #if DEBUG
            _positionDebugText=new TextComponent(game,_scoreFont,new Vector2(),Color.Red);
            Components.Add(_positionDebugText);
            #endif
        }