Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2015
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.26 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using Microsoft.Xna.Framework;
  6. using Microsoft.Xna.Framework.Content;
  7. using Microsoft.Xna.Framework.Graphics;
  8.  
  9. namespace Platformer2D.Map_Objects
  10. {
  11.     public class Tiles
  12.     {
  13.         protected Texture2D texture;
  14.         private Rectangle rectangle;
  15.         public Rectangle Rectangle
  16.         {
  17.             get
  18.             {
  19.                 return rectangle;
  20.             }
  21.             protected set
  22.             {
  23.                 rectangle = value;
  24.             }
  25.         }
  26.  
  27.         private static ContentManager content;
  28.         public static ContentManager Content
  29.         {
  30.             protected get
  31.             {
  32.                 return content;
  33.             }
  34.             set
  35.             {
  36.                 content = value;
  37.             }
  38.         }
  39.  
  40.         public void Draw(SpriteBatch spriteBatch)
  41.         {
  42.             spriteBatch.Draw(texture, rectangle, Game.defaultColour);
  43.         }
  44.     }
  45.  
  46.     public class CollisionTiles : Tiles
  47.     {
  48.         public CollisionTiles(int i, Rectangle newRectangle)
  49.         {
  50.             texture = Content.Load<Texture2D>("Graphics/Tiles/tile_" + i);
  51.             this.Rectangle = newRectangle;
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement