Ejemplo n.º 1
0
 protected virtual void Start()
 {
     turret                   = transform.parent.GetComponent <RocketTurret>();
     target                   = turret.target;
     damage                   = turret.damage;
     speed                    = turret.bulletSpeed;
     bulletImpactEffect       = turret.bulletImpactEffect;
     explosionTargetLayerMask = turret.explosionTargetLayerMask;
     explosionRadius          = turret.explosionRadius;
 }
Ejemplo n.º 2
0
        public override void HandleInput()
        {
            InputHelper input = game.inputManager.inputHelper;

            if (input.IsNewButtonPress(MouseButtons.LeftButton))
            {
                Vector2 position = ProjectionHelper.PixelToFarseer(input.MousePosition);

                List <Fixture> list = game.farseerManager.world.TestPointAll(position);

                RocketTurret t;

                if (list.Count == 0)
                {
                    t = new RocketTurret(position, game.farseerManager.world, game.ragdollManager);
                }
                else
                {
                    t = new RocketTurret(position, game.farseerManager.world, game.ragdollManager, list[0]);
                }

                game.hazardManager.addHazard(t);
            }
        }
Ejemplo n.º 3
0
    public override void Start()
    {
        InitScript.inGame = true;
        InitScript.totalScore = 0;
        bonusSpeed = 2f;
        score = 0;
        value1 = 0;
        value2 = 0;
        value3 = 0;
        FrameCounter = 120;
        obstacles = new List<Obstacle>();
        powerups = new List<Powerup>();
        bullets = new List<Bullet>();

        background = new Starfield(InitScript.bg1Pos,false);
        Futile.stage.AddChild(background);

        background2 = new Starfield(InitScript.bg2Pos, false);
        Futile.stage.AddChild(background2);

        bar = new EnergyBar();
        Futile.stage.AddChild(bar);

        walls = new FSprite("AwesomeWall.png");
        walls.scale = 2.0f;
        walls.x = 0;
        Futile.stage.AddChild(walls);

        //score stuffffff
        digit1 = new FSprite("0.png");
        digit1.scale = 2.0f;
        digit1.x = -159.7772f + 180;
        digit1.y = Futile.screen.halfHeight - 57;
        Futile.stage.AddChild(digit1);

        digit2 = new FSprite("0.png");
        digit2.scale = 2.0f;
        digit2.x = -159.7772f + 160;
        digit2.y = Futile.screen.halfHeight - 57;
        Futile.stage.AddChild(digit2);

        digit3 = new FSprite("0.png");
        digit3.scale = 2.0f;
        digit3.x = -159.7772f + 140;
        digit3.y = Futile.screen.halfHeight - 57;
        Futile.stage.AddChild(digit3);

        ///////

        testPlayer = new Spaceman();
        Futile.stage.AddChild(testPlayer);
        testPlayer.PlayerAlive();

        victoryFlare = new FSprite("Victory0.png");
        victoryFlare.scale = 2.0f;
        victoryFlare.x = 159.7772f - 30;
        victoryFlare.y = -Futile.screen.halfHeight + 160;
        Futile.stage.AddChild(victoryFlare);

        btnPause = new FButton("PauseButton.png");
        btnPause.x = -159.7772f + 12;
        btnPause.y = Futile.screen.halfHeight - 12;
        btnPause.scale = 2.0f;
        //btnPause.isVisible = false;
        Futile.stage.AddChild(btnPause);

        turret = new Turret();
        Futile.stage.AddChild(turret);

        laser = new LazerTurret();
        Futile.stage.AddChild(laser);

        laserActual = new Lazer();
        Futile.stage.AddChild(laserActual);

        rocket = new RocketTurret();
        Futile.stage.AddChild(rocket);

        pausedScreen = new FSprite("Paused0.png");
        pausedScreen.scale = 2.0f;
        pausedScreen.isVisible = false;
        Futile.stage.AddChild(pausedScreen);

        InitScript.blackBar1.MoveToTop();
        InitScript.blackBar2.MoveToTop();

        btnPause.SignalRelease += HandlePauseButtonRelease;
        Futile.instance.SignalUpdate += HandleUpdate;
    }