예제 #1
0
파일: Program.cs 프로젝트: Nerminkrus/Spel
 /// <summary>
 /// The main entry point for the application.
 /// </summary>
 static void Main(string[] args)
 {
     using (Game1 game = new Game1())
     {
         game.Run();
     }
 }
예제 #2
0
파일: Level.cs 프로젝트: Gee-Bee/Pacman
 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");
 }
예제 #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;
 }
예제 #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;
 }
예제 #5
0
파일: Level.cs 프로젝트: Gee-Bee/Pacman
 public static Level create(Game1 game, GraphicsDeviceManager graphics)
 {
     return new Level(game, graphics.PreferredBackBufferWidth / elWidth, graphics.PreferredBackBufferHeight / elHeight);
 }
예제 #6
0
 public static PelletSprite create(Game1 game)
 {
     return new PelletSprite(game.Content.Load<Texture2D>("Sprites/pellet"));
 }
예제 #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);
 }