can someone help me with a inventory to a game

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rakarna
Forum Newbie
Posts: 2
Joined: Thu Jun 04, 2009 12:12 pm

can someone help me with a inventory to a game

Post by rakarna »

hi can someone please help me to build, or link me to a page were i can read about how to make a inventory. i am working on a webb game and need a inventory to it. if you know anything please post it.

i have search on the world wilde webb but cant found anything :banghead:
User avatar
mikemike
Forum Contributor
Posts: 355
Joined: Sun May 24, 2009 5:37 pm
Location: Chester, UK

Re: can someone help me with a inventory to a game

Post by mikemike »

Not sure what you mean exactly. Is this PHP-related?
rakarna
Forum Newbie
Posts: 2
Joined: Thu Jun 04, 2009 12:12 pm

Re: can someone help me with a inventory to a game

Post by rakarna »

ye i have made my webb game in php and now i want to make a inventory so ea member can buy stuff. but i am not sure if this is posible in php.
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: can someone help me with a inventory to a game

Post by Chalks »

it's certainly possible. You will want to create a database using mysql (easiest). Here is a great tutorial for learning how to use mysql with php. Once you understand what tables are, a simple inventory table should look something like this:

Table Inventory
Fields
  • userID int
  • itemID int
  • quantity int
  • baseValue int
a sample item in the table would be:
userID-12345, itemID-123, quantity-4, baseValue-200

you would need a few other tables like a User table and an Item table so that you can use the IDs to look up who owns what.
edit:

Table User
fields
  • userID int
  • uName varchar(100)
  • any other fields you want
Table Items
fields
  • itemID int
  • iName varchar(100)
  • baseDmg int
  • range int
  • hitChance int
a sample item:
itemID-123, iName-"Deathglomp Phaser", baseDmg-20, range-5, hitChance-60
Post Reply