コード例 #1
0
        public override void onUpdate()
        {
            if (target != null && obj != null)
            {
                Vector toTarget     = target.Position - obj.Position;
                Vector toTargetUnit = toTarget.UnitSafe;

                if (toTarget.Length + 1 > camSpeed)
                {
                    obj.Position += toTargetUnit * camSpeed;
                }
                else
                {
                    target.Y = Math.Min(2600, target.Y + 7);
                    camSpeed = 7;

                    if (!water.Sink)
                    {
                        water.Sink = true;
                    }
                    if (!water.Active)
                    {
                        camMaster.Target = "Player";
                        Active           = false;
                        obj.close();
                        camMaster.ObeyCamZones = true;
                    }
                }
            }
        }
コード例 #2
0
ファイル: DoorTester.cs プロジェクト: slagusev/whiskey2d
        public override void onUpdate()
        {
            if (!startDoor)
            {
                obj.Position += objVel;
            }
//
            if (Math.Abs(door.Position.X - obj.Position.X) < 25 && !startDoor)
            {
                startDoor = true;
                //obj.close();
                //Level.Camera.TargetZoom = 1.2f;
                objVel = Vector.Zero;
            }
            if (startDoor && !startWater)
            {
                if (door.Y > 0)
                {
                    door.Y -= 4;
                }
                else
                {
                    startWater = true;
                    objVel     = (new Vector(water.X, water.Bounds.Top) - obj.Position).UnitSafe * 15f;
                }
            }
            if (startWater)
            {
                if (Math.Abs(water.Bounds.Top - obj.Position.Y) > 3)
                {
                    obj.Position += objVel;
                }
                else
                {
                    if (water != null && !water.Sink)
                    {
                        water.Sink = true;
                    }
                    objVel = (new Vector(0, water.Bounds.Top - obj.Position.Y)).UnitSafe * 3f;
                }
                if (!water.Active)
                {
                    camMaster.Target = "Player1";
                    Active           = false;
                    obj.close();
                    camMaster.ObeyCamZones             = true;
                    plr.getScript("PlayerMove").Active = true;
                }
            }
        }
コード例 #3
0
ファイル: Phase2.cs プロジェクト: slagusev/whiskey2d
        public override void onUpdate()
        {
            if (target != null && obj != null)
            {
                Vector toTarget     = target.Position - obj.Position;
                Vector toTargetUnit = toTarget.UnitSafe;


                if (toTarget.Length < camSpeed * 15)
                {
                    Level.Camera.TargetZoom = .7f;
                }

                if (toTarget.Length + 1 > camSpeed)
                {
                    obj.Position += toTargetUnit * camSpeed;
                }
                else
                {
                    wall.Y = Math.Max(wall.Y - 5, 1200);

                    if (wall.Y < 1201 && phaseNum == 0)
                    {
                        target = Objects.getObject <DebugObject>("phase2CamSpotb");
                        Level.Camera.TargetZoom = .2f;
                        phaseNum++;
                        Objects.getObject <Wall>("Platform").Speed = 4;
                    }
                    else if (phaseNum == 1)
                    {
                        camMaster.Target = "Player";
                        Active           = false;
                        obj.close();
                        camMaster.ObeyCamZones = true;
                    }
                }
            }
        }
コード例 #4
0
ファイル: DroneControl.cs プロジェクト: slagusev/whiskey2d
        public override void onClose()
        {
            float        x    = Math.Sign(vis.Sprite.Scale.X);
            SpriteEffect boom = new SpriteEffect(Level);

            boom.Effect        = "bigBang";
            boom.Frames        = new Vector(1, 48);
            boom.Position      = Gob.Position;
            boom.Speed         = 1;
            boom.Sprite.Scale *= 1.5f;

            vis.close();

            SpriteEffect death = new SpriteEffect(Level);

            death.Effect       = "enemy1c";
            death.Frames       = new Vector(1, 27);
            death.Position     = Gob.Position + new Vector(0, -75);;
            death.Speed        = 13;
            death.StartFrame   = 7;
            death.EndFrame     = 13;
            death.Sprite.Scale = new Vector(x, 1) * 1.5f;
        }
コード例 #5
0
ファイル: WormControl.cs プロジェクト: slagusev/whiskey2d
        public override void onClose()
        {
            float        x    = Math.Sign(vis.Sprite.Scale.X);
            SpriteEffect boom = new SpriteEffect(Level);

            boom.Effect        = "bigBang";
            boom.Frames        = new Vector(1, 48);
            boom.Position      = Gob.Position;
            boom.Speed         = 1;
            boom.Sprite.Scale *= 1.5f;

            vis.close();

            SpriteEffect death = new SpriteEffect(Level);

            death.Effect       = "enemy2c";
            death.Frames       = new Vector(2, 16);
            death.Position     = Gob.Position + new Vector(0, 0);;
            death.Speed        = 13;
            death.StartFrame   = 12;
            death.EndFrame     = 16;
            death.Sprite.Scale = new Vector(x * Gob.Sprite.Scale.X, Gob.Sprite.Scale.Y) / 300;
        }