Exemple #1
0
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
Exemple #2
0
 public Level(Game1 game, int width, int height)
 {
     this.game = game;
     els = new LevelElement[height, width];
     int b0 = els.GetUpperBound(0);
     int b1 = els.GetUpperBound(1);
     ReadLevel("Levels/1.txt");
 }
Exemple #3
0
 public GhostSprite(Game1 game, Texture2D p0, Texture2D p1, int screenWidth, int screenHeight, int velocity, Color color)
     : base(game, p0, p1, screenWidth, screenHeight, velocity, color)
 {
     position = new Vector2(
         random.Next(0 + (int)Math.Ceiling(size.X / 2), screenWidth - (int)Math.Ceiling(size.X / 2)),
         random.Next(0 + (int)Math.Ceiling(size.Y / 2), screenHeight - (int)Math.Ceiling(size.Y / 2))
     ) / size * size - size / 2;
 }
Exemple #4
0
 public CharacterSprite(Game1 game, Texture2D p0, Texture2D p1, int screenWidth, int screenHeight, int velocity, Color color)
 {
     texture = texture0 = p0;
     texture1 = p1;
     screenSize = new Vector2(screenWidth, screenHeight);
     direction = requestedDirection = Direction.Right;
     position = screenSize / 2 / size * size - size /2;
     this.velocity = velocity;
     this.color = color;
     this.game = game;
 }
Exemple #5
0
 public static Level create(Game1 game, GraphicsDeviceManager graphics)
 {
     return new Level(game, graphics.PreferredBackBufferWidth / elWidth, graphics.PreferredBackBufferHeight / elHeight);
 }
Exemple #6
0
 public static PelletSprite create(Game1 game)
 {
     return new PelletSprite(game.Content.Load<Texture2D>("Sprites/pellet"));
 }
Exemple #7
0
 public static GhostSprite create(Game1 game, GraphicsDeviceManager graphics, Color color)
 {
     return new GhostSprite(game, game.Content.Load<Texture2D>("Sprites/ghost0"), game.Content.Load<Texture2D>("Sprites/ghost1"),
         graphics.PreferredBackBufferWidth, graphics.PreferredBackBufferHeight, 2, color);
 }