Esempio n. 1
0
        public virtual void Draw(SpriteBatch spriteBatch)
        {
            foreach (Tile t in tiles)
            {
                t.Draw(spriteBatch);
            }

            player.Draw(spriteBatch);
            foreach (Entity e in entityList)
            {
                e.Draw(spriteBatch);
            }

            spriteBatch.Draw(Archive.textureDictionary["uiWorld"], Vector2.Zero, Color.White);
            tabManager.Draw(spriteBatch);

            foreach (Entity e in entityList)
            {
                if (e is FriendlyEntity)
                {
                    FriendlyEntity npc = (FriendlyEntity)e;
                    if (npc.CanTalk(player))
                    {
                        npc.dialog.Draw(spriteBatch, new Vector2(740, 957));
                    }
                }
            }
        }
Esempio n. 2
0
        public void Update(GameTime gameTime)
        {
            tabManager.Update(gameTime);
            player.Update(gameTime);

            foreach (Entity e in entityList)
            {
                if (e is FriendlyEntity)
                {
                    FriendlyEntity npc = (FriendlyEntity)e;
                    if (npc.CanTalk(player))
                    {
                        npc.dialog.Update(this);
                    }
                    else
                    {
                        npc.dialog.StopTalking();
                    }
                }
            }

            for (int i = entityList.Count() - 1; i >= 0; i--)
            {
                if (entityList[i] is ItemEntity)
                {
                    ItemEntity itemEntity = (ItemEntity)entityList[i];
                    if (player.PickUpItem(itemEntity))
                    {
                        Archive.soundEffectDictionary["pickUp"].Play();
                        entityList.RemoveAt(i);
                        foreach (Quest q in tabManager.questTab.questSystem.quests)
                        {
                            foreach (Objective o in q.objectives)
                            {
                                if (o is ItemObjective)
                                {
                                    ItemObjective oItem = (ItemObjective)o;
                                    oItem.CompareItem(itemEntity.containedItem.ID);
                                }
                            }
                        }
                    }
                }
            }
        }