0
\$\begingroup\$

So i decided to write my games data files in xml since a lot of people recommend it security wise for an online game, but how exactly does one render an xml tile grid in java?

format will be as follows:

<Data>
   <Tile X="1" Y="1" Value="12"></Tile>
</Data>
\$\endgroup\$
3
  • 1
    \$\begingroup\$ People recommend XML security-wise? That doesn't make sense. \$\endgroup\$ Commented Jan 4, 2015 at 11:34
  • \$\begingroup\$ What does the Value mean? \$\endgroup\$ Commented Jan 5, 2015 at 12:11
  • \$\begingroup\$ Tile type as in like if value = 12, it's a grass tile \$\endgroup\$ Commented Jan 5, 2015 at 17:18

1 Answer 1

2
\$\begingroup\$

XML is just a data storage (or transfer) format. The XML file itself has nothing to do with rendering tilemaps. You actually need to have the data in memory in a better format suited for rendering tile maps.

I think you should tackle the problem from another direction. Rather than trying to figure out how to render XML data as tile map, you should just learn to render tile maps, and then save that data in a XML file.

\$\endgroup\$
4
  • \$\begingroup\$ So kinda like having a tile map in a image file and have an xml file have the information on what each color pixel represents? \$\endgroup\$ Commented Jan 4, 2015 at 22:10
  • \$\begingroup\$ You must have the tilemap data in memory somehow when you are rendering it. After you are able to render the tilemap, you can save the data you rendered the tilemap with in a XML or some other file format for future use. \$\endgroup\$ Commented Jan 4, 2015 at 22:15
  • \$\begingroup\$ Do you have any where that can teach me that or a place I can go to study how to do that? Like a YouTube video or website? \$\endgroup\$ Commented Jan 4, 2015 at 22:18
  • \$\begingroup\$ There is bunch of links about rendering tilemaps in java behind the link in my answer. I could just do a quick google search for reading and writing xml files in java too, but you are better off learning how to do google searches yourself. \$\endgroup\$ Commented Jan 4, 2015 at 22:29

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.