Example #1
0
        //public void DeleteObjectsAtPoint(Vector2 point)
        //{
        //   RemoveObjects(GetObjectsIntersectsPoint(point));
        //}

        public void Draw(GameRegistry registry, SpriteBatch spriteBatch, Vector2 screenPos, Vector2 screenSize)
        {
            GamePoleObject[] o2d = GetObjectsIntersectsRect(new FloatRectangle(screenPos.X, screenPos.Y, screenSize.X, screenSize.Y)).OrderBy((GamePoleObject o) => o.Layer).ToArray();
            for (int i = 0; i < o2d.Length; i++)
            {
                o2d[i].Draw(registry, spriteBatch, screenPos);
            }
        }
Example #2
0
        public override void Draw(GameRegistry registry, SpriteBatch spriteBatch, Vector2 screenPos)
        {
            Texture2D chest  = registry.GetTexture("chest");
            Rectangle src    = GetSourceRect();
            Vector2   pos    = Position - screenPos;
            Vector2   origin = Vector2.Zero;

            spriteBatch.Draw(chest, pos, src, Color.White, 0f, origin, 1f, SpriteEffects.None, 0);
        }
Example #3
0
        public override void Draw(GameRegistry registry, SpriteBatch spriteBatch, Vector2 screenPos)
        {
            Texture2D tiles  = registry.GetTexture("tiles");
            Rectangle src    = GetSourceRect();
            Vector2   pos    = Position - screenPos;
            Color     color  = _isObstacle ? Color.White * 0.75f : Color.White;
            Vector2   origin = Vector2.Zero;

            spriteBatch.Draw(tiles, pos, src, color, 0f, origin, 1f, SpriteEffects.None, 0);
        }
Example #4
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     Content.RootDirectory = "Content";
     player      = new Player(this);
     player.Type = 1;
     player.AddItem(new ItemStack(Items.torch, 12));
     currentLocation    = new Location(this);
     particleController = new ParticleController();
     gameRegistry       = new GameRegistry();
 }
Example #5
0
 public void Update(GameRegistry registry, GameTime gameTime)
 {
     for (int i = 0; i < objects.Count; i++)
     {
         var obj = objects[i];
         obj.Update(registry, gameTime);
         if (obj.Moved)
         {
             cache.ObjectMove(obj);
             obj.Moved = false;
         }
     }
 }
Example #6
0
        public override void Update(GameRegistry registry, GameTime gameTime)
        {
            if (gameTime.TotalGameTime - lastAnimationFrame >= animationFrameLength && isOpening)
            {
                lastAnimationFrame = gameTime.TotalGameTime;

                if (AnimationFrame < 3)
                {
                    AnimationFrame++;
                }
                else
                {
                    isOpening = false;
                    openingBy.AddItem(new ItemStack(Items.goldCoin, 2));
                }
            }
        }
Example #7
0
 public virtual void Update(GameRegistry registry, GameTime gameTime)
 {
 }
Example #8
0
 public virtual void Draw(GameRegistry registry, SpriteBatch spriteBatch, Vector2 screenPos)
 {
 }
Example #9
0
 public override void Update(GameRegistry registry, GameTime gameTime)
 {
 }