示例#1
0
        public Level1(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 35f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 0f, -360f);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 0f, -720f);
            planes.Add(currentPlane);

            //goal
            goal = new GoalObject(game, host);
            goal.position += new Vector3(0, 20, -820);
            goal.scale = 10;

            //death bound for this level
            m_fDeathBound = -100f;
        }
示例#2
0
 // Use this for initialization
 void Start()
 {
     source = GetComponent <AudioSource>();
     goal   = FindObjectOfType <GoalObject>();
     source.PlayOneShot(Music, 0.8f);
     startTime = Time.time;
 }
示例#3
0
        public Level1(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 35f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 0f, -360f);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 0f, -720f);
            planes.Add(currentPlane);

            //goal
            goal           = new GoalObject(game, host);
            goal.position += new Vector3(0, 20, -820);
            goal.scale     = 10;



            //death bound for this level
            m_fDeathBound = -100f;
        }
        public CollectableTest(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 25f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, -10f, 0);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 10;
            currentPlane.position += new Vector3(200f, -10f, -300f);
            currentPlane.setLocalRotation(0, (float)Math.PI / 18);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 10;
            currentPlane.position += new Vector3(-250f, -10f, -200f);
            currentPlane.setLocalRotation(0.123f, -(float)Math.PI / 18);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 5;
            currentPlane.position += new Vector3(-220f, 10f, 80f);
            planes.Add(currentPlane);



            //moving level piece
            MovingLevelPiece movingPlane;

            //50 is a good movement speed
            movingPlane           = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(0, 100f, 0f), 50);
            movingPlane.scale     = 5;
            movingPlane.position += new Vector3(0f, 0f, -250f);
            planes.Add(movingPlane);

            goal           = new GoalObject(game, host);
            goal.position += new Vector3(0, 10, -50);
            goal.scale     = 5;
            //game.Components.Add(goal);

            //foreach (LevelPiece p in planes)
            //{
            //    game.Components.Add(p);
            //}

            Collectable collect1 = new Collectable(game, host);

            collect1.position = new Vector3(40, 10, 40);
            collectables.Add(collect1);

            //foreach (Collectable collect in collectables)
            //{
            //    game.Components.Add(collect);
            //}
        }
        public CollectableTest(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 25f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, -10f, 0);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 10;
            currentPlane.position += new Vector3(200f, -10f, -300f);
            currentPlane.setLocalRotation(0, (float)Math.PI / 18);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 10;
            currentPlane.position += new Vector3(-250f, -10f, -200f);
            currentPlane.setLocalRotation(0.123f, -(float)Math.PI / 18);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 5;
            currentPlane.position += new Vector3(-220f, 10f, 80f);
            planes.Add(currentPlane);

            //moving level piece
            MovingLevelPiece movingPlane;
            //50 is a good movement speed
            movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(0, 100f, 0f), 50);
            movingPlane.scale = 5;
            movingPlane.position += new Vector3(0f, 0f, -250f);
            planes.Add(movingPlane);

            goal = new GoalObject(game, host);
            goal.position += new Vector3(0, 10, -50);
            goal.scale = 5;
            //game.Components.Add(goal);

            //foreach (LevelPiece p in planes)
            //{
            //    game.Components.Add(p);
            //}

            Collectable collect1 = new Collectable(game, host);
            collect1.position = new Vector3(40, 10, 40);
            collectables.Add(collect1);

            //foreach (Collectable collect in collectables)
            //{
            //    game.Components.Add(collect);
            //}
        }
示例#6
0
    // Start is called before the first frame update
    void Start()
    {
        moveright = true;
        movef     = false;

        //Rigidbodyを取得
        rb = GetComponent <Rigidbody2D>();

        Player          = GameObject.Find("MotionPlayer");
        playerconroller = Player.GetComponent <PlayerController>();

        Goalconroller = Goal.GetComponent <GoalObject>();
    }
示例#7
0
        public Level3(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 35f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            /*
             * currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
             * currentPlane.scale = 15;
             * currentPlane.position += new Vector3(0f, 0f, -360f);
             * planes.Add(currentPlane);
             */

            //moving level piece
            MovingLevelPiece movingPlane;

            movingPlane           = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(0, -500f, 0), 80f);
            movingPlane.scale     = 15;
            movingPlane.position += new Vector3(0f, 400f, -360f);
            planes.Add(movingPlane);

            //wall
            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 160f, -550f);
            currentPlane.setLocalRotation((float)Math.PI / 2, 0);
            planes.Add(currentPlane);

            //cloud above wall
            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 300f, -730f);
            planes.Add(currentPlane);


            //goal
            goal           = new GoalObject(game, host);
            goal.position += new Vector3(0, 300, -830);
            goal.scale     = 10;


            //death bound for this level
            m_fDeathBound = -250f;
        }
        public SimpleLevel(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 25f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, -10f, 0);
            planes.Add(currentPlane);

            goal = new GoalObject(game, host);
            goal.position += new Vector3(40, 10, -20);
            goal.scale = 5;
        }
示例#9
0
    void OnTriggerExit(Collider other)
    {
        GoalObject go = other.gameObject.GetComponent <GoalObject>();

        if (go != null)
        {
            // find it in original set of GoalObjects and set that it's not inside task space
            for (int i = 0; i < goalObjects.Length; i++)
            {
                if (goalObjects[i].gameObject.GetInstanceID() == go.gameObject.GetInstanceID())
                {
                    go.setInsideTaskSpace(false);
                }
            }
        }
    }
示例#10
0
        public Level3(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 35f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            /*
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 0f, -360f);
            planes.Add(currentPlane);
            */

            //moving level piece
            MovingLevelPiece movingPlane;
            movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(0, -500f, 0), 80f);
            movingPlane.scale = 15;
            movingPlane.position += new Vector3(0f, 400f, -360f);
            planes.Add(movingPlane);

            //wall
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 160f, -550f);
            currentPlane.setLocalRotation((float)Math.PI / 2, 0);
            planes.Add(currentPlane);

            //cloud above wall
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 300f, -730f);
            planes.Add(currentPlane);

            //goal
            goal = new GoalObject(game, host);
            goal.position += new Vector3(0, 300, -830);
            goal.scale = 10;

            //death bound for this level
            m_fDeathBound = -250f;
        }
示例#11
0
        public Level2(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(1f, 35f, 1f);
            //make a few planes

            CollisionLevelPiece currentPlane;

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            MovingLevelPiece movingPlane;

            movingPlane           = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), 85f);
            movingPlane.scale     = 15;
            movingPlane.position += new Vector3(-150f, 0f, -360f);
            planes.Add(movingPlane);

            movingPlane           = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), -85f);
            movingPlane.scale     = 15;
            movingPlane.position += new Vector3(150f, 0f, -720f);
            planes.Add(movingPlane);

            movingPlane           = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), 85f);
            movingPlane.scale     = 15;
            movingPlane.position += new Vector3(-150f, 0f, -1080f);
            planes.Add(movingPlane);

            movingPlane           = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), -85f);
            movingPlane.scale     = 15;
            movingPlane.position += new Vector3(150f, 0f, -1440f);
            planes.Add(movingPlane);


            //goal
            goal           = new GoalObject(game, host);
            goal.position += new Vector3(0, 20, -1540f);
            goal.scale     = 10;


            //death bound for this level
            m_fDeathBound = -100f;
        }
示例#12
0
        public SimpleLevel(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(10f, 25f, 0f);
            //make a few planes
            CollisionLevelPiece currentPlane;

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, -10f, 0);
            planes.Add(currentPlane);



            goal           = new GoalObject(game, host);
            goal.position += new Vector3(40, 10, -20);
            goal.scale     = 5;
        }
示例#13
0
        public Level2(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(1f, 35f, 1f);
            //make a few planes

            CollisionLevelPiece currentPlane;
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            MovingLevelPiece movingPlane;
            movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), 85f);
            movingPlane.scale = 15;
            movingPlane.position += new Vector3(-150f, 0f, -360f);
            planes.Add(movingPlane);

            movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), -85f);
            movingPlane.scale = 15;
            movingPlane.position += new Vector3(150f, 0f, -720f);
            planes.Add(movingPlane);

            movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), 85f);
            movingPlane.scale = 15;
            movingPlane.position += new Vector3(-150f, 0f, -1080f);
            planes.Add(movingPlane);

            movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), -85f);
            movingPlane.scale = 15;
            movingPlane.position += new Vector3(150f, 0f, -1440f);
            planes.Add(movingPlane);

            //goal
            goal = new GoalObject(game, host);
            goal.position += new Vector3(0, 20, -1540f);
            goal.scale = 10;

            //death bound for this level
            m_fDeathBound = -100f;
        }
示例#14
0
 public ObjectFacingDirection(GoalObject target)
 {
     this.target = target;
     side        = RandomSide();
 }
示例#15
0
 public ObjectByAnyWall(GoalObject target)
 {
     this.target = target;
 }
示例#16
0
 public ObjectByCorner(GoalObject target)
 {
     this.target = target;
     corner      = RandomCorner();
 }
示例#17
0
 public ObjectBySideWall(GoalObject target)
 {
     this.target = target;
     side        = RandomSide();
 }
示例#18
0
 public ObjectInMIddleOfRoom(GoalObject target)
 {
     this.target = target;
 }
示例#19
0
        public Level4(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(1f, 35f, 100f);
            //make a few planes

            CollisionLevelPiece currentPlane;
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            //Left arm

            //large arm

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 9;
            currentPlane.position += new Vector3(-180f, 0f, -288);
            planes.Add(currentPlane);

            //smaller arms
            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(-252f, 0f, -432);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(-108f, 0f, -432);
            planes.Add(currentPlane);

            //tiny arm

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(-252f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(-108f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(-252f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(-108f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(-252f, 0f, -528);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(-108f, 0f, -528);
            planes.Add(currentPlane);

            //small arm

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(-252f, 0f, -576);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(-108f, 0f, -576);
            planes.Add(currentPlane);

            //large arm

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 9;
            currentPlane.position += new Vector3(-180f, 0f, -720);
            planes.Add(currentPlane);

            //Right arm

            //large arm

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 9;
            currentPlane.position += new Vector3(180f, 0f, -288);
            planes.Add(currentPlane);

            //smaller arms

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(252f, 0f, -432);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(108f, 0f, -432);
            planes.Add(currentPlane);

            //tiny arms

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(252f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(108f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(252f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(108f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(252f, 0f, -528);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 1;
            currentPlane.position += new Vector3(108f, 0f, -528);
            planes.Add(currentPlane);

            //small arms

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(252f, 0f, -576);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 3;
            currentPlane.position += new Vector3(108f, 0f, -576);
            planes.Add(currentPlane);

            //large arm

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 9;
            currentPlane.position += new Vector3(180f, 0f, -720);
            planes.Add(currentPlane);

            //connecting bar

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 2;
            currentPlane.position += new Vector3(48f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 2;
            currentPlane.position += new Vector3(-48f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 2;
            currentPlane.position += new Vector3(0f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 2;
            currentPlane.position += new Vector3(0f, 0f, -852);
            planes.Add(currentPlane);

            currentPlane = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale = 2;
            currentPlane.position += new Vector3(0f, 0f, -900);
            planes.Add(currentPlane);

            //goal
            goal = new GoalObject(game, host);
            goal.position += new Vector3(0, 10, -1000);
            goal.scale = 10;

            //collectables

            //death bound for this level
            m_fDeathBound = -250f;
        }
示例#20
0
        public Level5(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(1f, 605f, 1f);
            //make a few planes

            CollisionLevelPiece currentPlane;

            currentPlane        = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.ScaleX = 30f;
            currentPlane.ScaleY = 15f;
            currentPlane.ScaleZ = 45f;

            currentPlane.position += new Vector3(0f, 40f, -200f);
            //currentPlane.setLocalRotation(MathHelper.ToRadians(-30), 0);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.ScaleX    = 10f;
            currentPlane.ScaleY    = 10f;
            currentPlane.ScaleZ    = 10f;
            currentPlane.position += new Vector3(-400f, 40f, -800f);
            currentPlane.setLocalRotation(0, MathHelper.ToRadians(-20));
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.ScaleX    = 10f;
            currentPlane.ScaleY    = 10f;
            currentPlane.ScaleZ    = 30f;
            currentPlane.position += new Vector3(400f, 40f, -1100f);
            currentPlane.setLocalRotation(0, MathHelper.ToRadians(20));
            planes.Add(currentPlane);


            MovingLevelPiece movingPlane;

            movingPlane           = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 485f, 0), 85f);
            movingPlane.scale     = 15;
            movingPlane.position += new Vector3(-350f, -150f, -1260f);
            planes.Add(movingPlane);


            /*
             * MovingLevelPiece movingPlane;
             * movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), 85f);
             * movingPlane.scale = 15;
             * movingPlane.position += new Vector3(-150f, 0f, -360f);
             * planes.Add(movingPlane);
             *
             * movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), -85f);
             * movingPlane.scale = 15;
             * movingPlane.position += new Vector3(150f, 0f, -720f);
             * planes.Add(movingPlane);
             *
             * movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), 85f);
             * movingPlane.scale = 15;
             * movingPlane.position += new Vector3(-150f, 0f, -1080f);
             * planes.Add(movingPlane);
             *
             * movingPlane = new MovingLevelPiece(game, host, "checker_plane_3", new Vector3(300, 0f, 0), -85f);
             * movingPlane.scale = 15;
             * movingPlane.position += new Vector3(150f, 0f, -1440f);
             * planes.Add(movingPlane);
             */


            //goal
            goal           = new GoalObject(game, host);
            goal.position += new Vector3(150, -100, -1540);
            goal.scale     = 10;

            //collectables

            //death bound for this level
            m_fDeathBound = -250f;
        }
示例#21
0
        public Level4(Game game, GameplayScreen host)
            : base(game, host)
        {
            startingLocation = new Vector3(1f, 35f, 100f);
            //make a few planes

            CollisionLevelPiece currentPlane;

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 15;
            currentPlane.position += new Vector3(0f, 0f, 0);
            planes.Add(currentPlane);

            //Left arm


            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(-180f, 0f, -288);
            planes.Add(currentPlane);

            //smaller arms
            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-252f, 0f, -432);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-108f, 0f, -432);
            planes.Add(currentPlane);

            //tiny arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-252f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-108f, 0f, -480);
            planes.Add(currentPlane);


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-252f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-108f, 0f, -504);
            planes.Add(currentPlane);


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-252f, 0f, -528);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(-108f, 0f, -528);
            planes.Add(currentPlane);


            //small arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-252f, 0f, -576);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(-108f, 0f, -576);
            planes.Add(currentPlane);

            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(-180f, 0f, -720);
            planes.Add(currentPlane);



            //Right arm

            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(180f, 0f, -288);
            planes.Add(currentPlane);

            //smaller arms


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(252f, 0f, -432);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(108f, 0f, -432);
            planes.Add(currentPlane);

            //tiny arms

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(252f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(108f, 0f, -480);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(252f, 0f, -504);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(108f, 0f, -504);
            planes.Add(currentPlane);


            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(252f, 0f, -528);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 1;
            currentPlane.position += new Vector3(108f, 0f, -528);
            planes.Add(currentPlane);


            //small arms

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(252f, 0f, -576);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 3;
            currentPlane.position += new Vector3(108f, 0f, -576);
            planes.Add(currentPlane);

            //large arm

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 9;
            currentPlane.position += new Vector3(180f, 0f, -720);
            planes.Add(currentPlane);



            //connecting bar

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(48f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(-48f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(0f, 0f, -804);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(0f, 0f, -852);
            planes.Add(currentPlane);

            currentPlane           = new CollisionLevelPiece(game, host, "checker_plane_3");
            currentPlane.scale     = 2;
            currentPlane.position += new Vector3(0f, 0f, -900);
            planes.Add(currentPlane);



            //goal
            goal           = new GoalObject(game, host);
            goal.position += new Vector3(0, 10, -1000);
            goal.scale     = 10;

            //collectables

            //death bound for this level
            m_fDeathBound = -250f;
        }
示例#22
0
 public ObjectNearObject(GoalObject targetA, GoalObject targetB)
 {
     this.targetA = targetA;
     this.targetB = targetB;
 }
示例#23
0
 public ObjectFacingObject(GoalObject targetA, GoalObject targetB)
 {
     this.targetA = targetA;
     this.targetB = targetB;
 }
示例#24
0
        public void Update(GameTime gameTime, GoalObject goal)
        {
            const int deg = 45;

            // ゴールとプレイヤーの角度を求める
            double playerDeg = MathHelper.ToDegrees((float)Math.Atan2(goal.Position2.Y - player.Position2.Y, goal.Position2.X - player.Position2.X));

            // ゴールとプレイヤーの角度を求める
            double playerDistance = Math.Sqrt((goal.Position2.X - player.Position2.X) * (goal.Position2.X - player.Position2.X) + (goal.Position2.Y - player.Position2.Y) * (goal.Position2.Y - player.Position2.Y));

            foreach (Enemy enemy in enemies)
            {
                #region 後ろにいる敵はテレポート
                // ゴールとエネミーの角度を求める
                double enemyDeg = MathHelper.ToDegrees((float)Math.Atan2(goal.Position2.Y - enemy.Position2.Y, goal.Position2.X - enemy.Position2.X));

                // ゴールとプレイヤーの角度、ゴールとエネミーの角度がだいたい等しければフラグを立てる
                bool flag1 = Math.Abs(playerDeg - enemyDeg) < deg || Math.Abs((playerDeg + 180) % 360 - (enemyDeg + 180) % 360) < deg;

                // ゴールとエネミーの角度を求める
                double enemyDistance = Math.Sqrt((goal.Position2.X - enemy.Position2.X) * (goal.Position2.X - enemy.Position2.X) + (goal.Position2.Y - enemy.Position2.Y) * (goal.Position2.Y - enemy.Position2.Y));

                // プレイヤーよりエネミーのほうがゴールより遠ければフラグを立てる
                bool flag2 = playerDistance < enemyDistance;

                // エネミーがプレイヤーから見えていなければフラグを立てる
                bool flag3 = Math.Sqrt((player.Position2.X - enemy.Position2.X) * (player.Position2.X - enemy.Position2.X) + (player.Position2.Y - enemy.Position2.Y) * (player.Position2.Y - enemy.Position2.Y)) > 16;

                // ゴールがプレイヤーから見えていなければフラグを立てる
                bool flag4 = playerDistance > 16;

                // 全条件が揃ったらテレポートさせる
                if (flag1 && flag2 && flag3 && flag4)
                {
                    enemy.Teleport(goal.Position2);
                }

                //const int distance = 10;
                //bool ushiro = false;
                //if (player.DirecState == Collidable.Orientation.North)
                //{
                //    if (enemy.Position2.Y - player.Position2.Y > distance)
                //    {
                //        ushiro = true;
                //    }
                //}
                //else if (player.DirecState == Collidable.Orientation.South)
                //{
                //    if (player.Position2.Y - enemy.Position2.Y > distance)
                //    {
                //        ushiro = true;
                //    }
                //}
                //else if (player.DirecState == Collidable.Orientation.West)
                //{
                //    if (enemy.Position2.X - player.Position2.X > distance)
                //    {
                //        ushiro = true;
                //    }
                //}
                //else if (player.DirecState == Collidable.Orientation.East)
                //{
                //    if (player.Position2.X - enemy.Position2.X > distance)
                //    {
                //        ushiro = true;
                //    }
                //}
                //if (ushiro)
                //{
                //    enemy.Teleport(goal.Position2);
                //}

                #endregion

                enemy.Update(gameTime, maze);
            }
        }
示例#25
0
 public ObjectOnSideOfRoom(GoalObject target)
 {
     this.target = target;
     side        = RandomSide();
 }
示例#26
0
 public void StartGame()
 {
     _goalObject = Instantiate(goalPrefab);
     goal        = _goalObject.GetComponent <GoalObject>();
     GameStarted = true;
 }