source: 2012/27/DenisZ/TheDungeonGame/TheDungeonGame/TheDungeonGame/Item.cs @ 3563

Revision 3563, 972 bytes checked in by dezhidki, 9 years ago (diff)

Added some textures
Added basic ingame Gui
Added ability to hold and use items
Camera movement is now totaly fixed and working properly
Added ability to easily add and manage textures
Minor fixes on some stuff

Line 
1using System;
2using System.Collections.Generic;
3using System.Linq;
4using System.Text;
5using Jypeli;
6using Entity;
7
8namespace Items
9{
10   public class Item
11    {
12       public Image itemTexture;
13       private String name;
14       private Boolean isUsuable = false;
15
16       public Item(Image itemTexture, String name, bool usuable)
17       {
18           this.itemTexture = itemTexture;
19           this.name = name;
20           isUsuable = usuable;
21       }
22
23       public virtual bool useItem(TheDungeonGame game)
24       {
25           return isUsuable;
26       }
27
28       public virtual void onPickup(Player picker)
29       {
30           picker.ItemInInventory = this;
31           picker.updateGuiImage();
32       }
33
34       public ItemEntity createWorldObject()
35       {
36           ItemEntity result = new ItemEntity(this);
37           result.Image = itemTexture;
38           result.Tag = "Item";
39
40           return result;
41       }
42    }
43}
Note: See TracBrowser for help on using the repository browser.