Ejemplo n.º 1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
        public GameStatusLayer(Game game)
            : base(game)
        {
            parent = (Game1)game;
            screenRectangle = new Rectangle(Game1.SCREEN_WIDTH - 32, 0, 16, 720);
            playerRectangle = new Rectangle(screenRectangle.X - 8, 0, 32, 32);

            float offset = 4.0f;
            textPositionP1 = new Vector2(offset, 0);
            textPositionP2 = new Vector2(1000 + offset, 0);
        }
        public jumpAndRunPlayerFigure(Game1 game, World world, SpriteBatch spriteBatch)
            : base(game)
        {
            this.game = game;
            this.world = world;
            this.spriteBatch = spriteBatch;

            playerBody = BodyFactory.CreateCapsule(world, 1, 0.45f, 10);
            playerBody.BodyType = BodyType.Kinematic;
            playerBody.Position = new Vector2(0.0f, 0.0f);

            playerBody.OnCollision += new OnCollisionEventHandler(player_OnCollision);
        }
        public SavePlatform(Game game)
            : base(game)
        {
            parent = (Game1)game;

            // Create physical objects
            platformBody = BodyFactory.CreateRectangle(parent.World, 4, 1, 1.0f, parent.WaterLayer.Position + offsetToWater);
            platformBody.BodyType = BodyType.Kinematic;
            //platformBody.IgnoreGravity = true;
            //platformBody.IsStatic = true;
            platformBody.Friction = 100.0f;
            platformBody.CollisionCategories = Game1.COLLISION_GROUP_STATIC_OBJECTS;
            platformBody.CollidesWith = Game1.COLLISION_GROUP_TETRIS_BLOCKS | Game1.COLLISION_GROUP_DEFAULT;
        }
 public TitleScreenLayer(Game1 game)
     : base(game)
 {
     this.game = game;
     game.Components.Add(this);
 }
Ejemplo n.º 6
0
 public WaveLayer(Game1 game)
     : base(game)
 {
     this.game = game;
     Visible = false;
 }