예제 #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);
            }
        }
예제 #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);
        }
예제 #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);
        }
예제 #4
0
파일: Game1.cs 프로젝트: DCNick3/FGame
 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();
 }
예제 #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;
         }
     }
 }
예제 #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));
                }
            }
        }
예제 #7
0
 public virtual void Update(GameRegistry registry, GameTime gameTime)
 {
 }
예제 #8
0
 public virtual void Draw(GameRegistry registry, SpriteBatch spriteBatch, Vector2 screenPos)
 {
 }
예제 #9
0
 public override void Update(GameRegistry registry, GameTime gameTime)
 {
 }