1
\$\begingroup\$

I want to make a isometric tile game in java, like a lot of strategy games out there. What is the best approach to loading the map for this game? Would it be better practice to load one single image for the whole map, or would it be better to make images for each tile and render each tile using a int array?

\$\endgroup\$
  • \$\begingroup\$ Its way easier to use a spritesheet. Then just draw a section of the sprite sheet based on an array. This way you only load one image for the entire tilemap. Look into programes like Tiled if you want to tool to build tilesheets. \$\endgroup\$ – mobo Aug 26 '13 at 17:30
2
\$\begingroup\$

Its way easier to use a spritesheet. Then just draw a section of the sprite sheet based on an array. This way you only load one image for the entire tilemap. Look into programes like Tiled if you want to tool to build tilesheets.

Tiled.

\$\endgroup\$
1
\$\begingroup\$

If you use multiple textures, you will need to switch them in rendering. This process is expensive. You better use a single texture and use a index to represent each tile, with that index and tile size, you can calculate UV Textures to apply in your tile meshes.

\$\endgroup\$
  • \$\begingroup\$ So basicely make a spritesheet? \$\endgroup\$ – anonymous Aug 26 '13 at 17:50
  • \$\begingroup\$ Yes, not just tiles. Based on your problem, you can even place all your sprites in one texture. Are you using OpenGL? \$\endgroup\$ – felipe Aug 26 '13 at 18:12
  • \$\begingroup\$ I don't even know what OpenGL is until you pointed it out. I am using the Graphics2D object in java. Don't laugh.... \$\endgroup\$ – anonymous Aug 26 '13 at 18:15
  • \$\begingroup\$ Ok, in that case I don't know how exactly it works. You should read details about how things are done to achieve the performance you need. \$\endgroup\$ – felipe Aug 26 '13 at 18:17
  • \$\begingroup\$ You can use OpenGL in java using one of several libs for it. Like JOGL. \$\endgroup\$ – felipe Aug 26 '13 at 20:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.