예제 #1
0
 public void addGate(Gate gate)
 {
     gates.Add(gate);
 }
예제 #2
0
        /// <summary>
        /// LoadContent will be called once per game and is the place to load
        /// all of your content.
        /// </summary>
        protected override void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            if (world == null)
            {
                world = new World(new Vector2(0, 10));
            }
            Camera.init();
            spriteBatch = new SpriteBatch(GraphicsDevice);
            for (int i = 0; i < 2000; i+= 50)
            {
                //Obj obj = new Obj(this, 350, -300, -i, LoadTex("Character"));
                //obj.zSpeed = -1;
            }
            for (int i = 2000; i > 0; i -= 50)
            {
                //Obj obj = new Obj(this, -600,-300, -i, LoadTex("Character"));
                //Camera.Target = obj;
                //obj.alpha = 0.5f;
            }
            for (int i = -4000; i < 4000; i+=291)
            {
                //Obj obj = new Obj(this, i, 50, 0, LoadTex("Platform"));
                Wall floor = new Wall(this, i, 50, 0, 292, 275);
            }
            <<<<<<< HEAD
            for (int i = -4000; i < 4000; i += 291)
            {
                //Obj obj = new Obj(this, i, 50, 0, LoadTex("Platform"));
                Wall floor = new Wall(this, i * 2, -400, 0, 292, 275);
            }
            for (int i = -4000; i < 4000; i += 700)
            {
                Obj o = new Obj(this,i,-1300,0,LoadTex("Square"));
                o.createRecBody(1,0,1,true,true);
                o.type = Obj.PointType.SwingPoint;
            }
            //player = new Player(this, 100, 100, 0);
            =======
            player = new Player(this, 100, -600, 0);
            >>>>>>> 0a728cea804dcf5e74b2e6ecf1581c8cd9109996
            Obj swing = new Obj(this, 500, -300, 0, LoadTex("Platform"));
            swing.type = Obj.PointType.SwingPoint;
            Camera.Target = Global.Player;

            Gate gate = new Gate(this, 500, -100, 0);
            Key key = new Key(this, 300, -100, 0, Color.Red);
            key.addGate(gate);

            //create world for physics with gravity = -10

            Camera.Target = Global.Player;

            //create rigid floor
            //Wall floor = new Wall(this, 100, 0, 0, 1280, 20, true);
            ///floor.body.Position = ConvertUnits.ToSimUnits(240, 0);

            //obj.zSpeed = -1f;
            // TODO: use this.Content to load your game content here
        }
예제 #3
0
 public void addGate(Gate gate)
 {
     gates.Add(gate);
 }