Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
  1. #21
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    My inventory is a set length of 20 slots, and will be the only way a hero can carry items. This will not contain very super advanced awesome fun things like you'd find in WoW, I'm just looking for expanding my knowledge through practice.

    That being said, does your statement still stand?
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

  2. #22
    KevinWorkman's Avatar
    KevinWorkman is offline Crazy Cat Lady
    Join Date
    Oct 2010
    Location
    Washington, DC
    Posts
    4,041
    Rep Power
    10

    Default

    Quote Originally Posted by Dark View Post
    That being said, does your statement still stand?
    Which statement are you asking about? I read through all the posts, and all the advice is pretty solid. The item-that-contains-other-items would be good for a full game, but might be overkill for your purposes.

    If you have an inventory of 20 items, each one is going to be a separate instance of some class (so if you've got 20 daggers, you've got 20 instances of the Dagger class).

    If you're displaying them on screen, presumably you have some way to translate from an index to a location on the screen. That means you should have some way to translate from a location on the screen to an index. Alternatively, you presumably have a reference to the instance you're displaying, so deleting it from the List should be pretty easy.

    As we've seen here, there isn't one go-to method for using good OO design. Each person is going to have a slightly different take. Do whatever fits in your head the best, and go from there. Chances are, no matter what you write, you're going to come back to it in a year and say "what was I thinking when I did that??" anyway. So I wouldn't recommend you spend a ton of time on the design portion. It's good to know, but it's bad to spend too much time hammering square pegs into round holes. If it fits a certain way in your head, and it works, then that's the design you should use.

    That's just my two cents though.
    Last edited by KevinWorkman; 04-20-2011 at 02:46 PM.
    How to Ask Questions the Smart Way
    Static Void Games - Play indie games, learn from game tutorials and source code, upload your own games!

  3. #23
    Dark's Avatar
    Dark is offline Senior Member
    Join Date
    Apr 2011
    Location
    Camp Lejuene, North Carolina
    Posts
    643
    Rep Power
    4

    Default

    Yeah, I've decided I really shouldn't try and read logic when I first wake up. I've figured out what I want to do and we'll see how it turns out.
    • Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
    • +Rep people for helpful posts.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Minimax game theory with mancala
    By jigglywiggly in forum New To Java
    Replies: 2
    Last Post: 01-01-2010, 01:04 PM
  2. [SOLVED] Class question
    By Supamagier in forum Advanced Java
    Replies: 19
    Last Post: 05-12-2009, 06:11 PM
  3. I have some question about jar and class??
    By low224 in forum New To Java
    Replies: 2
    Last Post: 01-01-2009, 05:02 AM
  4. [SOLVED] Need help in theory of Java in netbeans
    By kirly in forum New To Java
    Replies: 3
    Last Post: 11-11-2008, 06:47 AM
  5. question regarding class
    By kavithas in forum New To Java
    Replies: 4
    Last Post: 11-16-2007, 10:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •