示例#1
0
文件: Assets.cs 项目: Coly010/Shudder
        public static List<Sprite> sprites = new List<Sprite>(); // List of sprites

        #endregion Fields

        #region Methods

        // Call this method to initalise all sprites in the game
        public static void AddSprite(Sprite s)
        {
            sprites.Add(s);
        }
示例#2
0
 // Add sprites to the sprite list for drawing
 public void set(Sprite spr)
 {
     sprites.Add(spr);
 }
示例#3
0
文件: Game.cs 项目: Coly010/Shudder
 // Add Sprites to the game
 public void AddSprite(Sprite s)
 {
     render.set(s);
 }
示例#4
0
文件: Sprite.cs 项目: Coly010/Shudder
 // Boolean to see if sprite is colliding with other sprite
 public bool IsColliding(Sprite spr)
 {
     if(position.x > spr.position.x && position.x < (spr.position.x + spr.size.x))
     {
         if(position.y > spr.position.y && position.y < (spr.position.y + spr.size.y))
         {
             return true;
         }
         else if((position.y + size.y) > spr.position.y && (position.y + size.y) < (spr.position.y + spr.size.y))
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     else if ((position.x + size.x) > spr.position.x && (position.x + size.x) < (spr.position.x + spr.size.x))
     {
         if (position.y > spr.position.y && position.y < (spr.position.y + spr.size.y))
         {
             return true;
         }
         else if ((position.y + size.y) > spr.position.y && (position.y + size.y) < (spr.position.y + spr.size.y))
         {
             return true;
         }
         else
         {
             return false;
         }
     }
     else
     {
         return false;
     }
 }