예제 #1
0
 private void coverScreen(DrawObject obj, int Y)
 {
     int drawAmount = (int)Math.Ceiling((double)screenWidth / (double)grassBlock.width);
     objDrawAmount = (int)Math.Ceiling((double)screenWidth / (double)grassBlock.width);
     obj.drawPlacement.X = (screenWidth - (obj.width * objDrawAmount)) / 2;
     obj.drawPlacement.Y = Y;
     obj.drawAmount = objDrawAmount;
 }
예제 #2
0
 public DrawBG(Game game, ContentManager content, SpriteBatch spriteBatch)
 {
     this.spriteBatch = spriteBatch;
     // TODO: Construct any child components here
     brownBlock = new DrawObject(game, content, "Brown Block", 1, new Vector2(10, 10));
     dirtBlock = new DrawObject(game, content, "Dirt Block", 5, new Vector2(0, roofWest.height));
     //roofEast = new DrawObject(game, content, "Roof East", 1, new Vector2(X, Y));
     //roofNorthEast = new DrawObject(game, content, "Roof North East", 4, new Vector2(X, Y));
     //roofNorthWest = new DrawObject(game, content, "Roof North West", 1, new Vector2(X, Y));
 }
예제 #3
0
 public GameOverScreen(Game game, ContentManager content, int screenWidth, int screenHeight)
 {
     // TODO: Construct any child components here
     this.screenHeight = screenHeight;
     this.screenWidth = screenWidth;
     grassBlock = new DrawObject(game, content, "Grass Block", 0, new Vector2(0, screenHeight/2));
     dirtBlock = new DrawObject(game, content, "Dirt Block", 2, new Vector2(screenWidth - grassBlock.width * 2, screenHeight - (grassBlock.height*2)));
     for (int i = 0; i < title.Length; i++) title[i] = content.Load<Texture2D>("Dirt Block");
     coverScreen(grassBlock, screenHeight - grassBlock.height);
 }