944,008 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 2027
  • Java RSS
Jun 25th, 2005
0

java 2d game(naming items)

Expand Post »
i want to name a item and give it a color(probs an int value)
i was thinking of doing a 2d array but I need to send it to another class
i create the item by
Monster m = new Monster(this);

any ideas
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
ultimate_fusion is offline Offline
44 posts
since Oct 2004
Jun 28th, 2005
0

Re: java 2d game(naming items)

you need to be a little more specific of what you're trying to do.

Quote ...
i want to name a item and give it a color
that could mean something as simple as this:

Java Syntax (Toggle Plain Text)
  1. class Item
  2. {
  3. String name;
  4. Color color;
  5. public Item(String name, Color color)
  6. {
  7. this.name = name;
  8. this.color = color;
  9. }
  10. }
  11.  
  12. Item myItem = new Item("monster", new Color(147,54,175));
Reputation Points: 92
Solved Threads: 51
Practically a Posting Shark
Phaelax is offline Offline
856 posts
since Mar 2004

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: Inheritance problems
Next Thread in Java Forum Timeline: java, bluetooth. cellphones and media player





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC