954,176 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

java 2d game(naming items)

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

ultimate_fusion
Light Poster
44 posts since Oct 2004
Reputation Points: 10
Solved Threads: 0
 

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

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

class Item
{
	String name;
	Color color;
	public Item(String name, Color color)
	{
		this.name = name;
		this.color = color;
	}
}
 
Item myItem = new Item("monster", new Color(147,54,175));
Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You