Jump to content
MakeWebGames

Recommended Posts

Posted

I'm currently working on a 2D RPG using java, however I have hit what you could call a slight problem. To create my Map, I'm going to tile together different 32 * 32 images.

At the moment I'm using an Array (int[] ) which stores different numbers to represent different tiles.

Then I'm using a Loop to loop through the array.

Something like:

for (int i = 0; i < Map.Map1.length; i++)
      for (int j=1; I < Map.Map1.length; j++)
               {
                   // Tiling Code Here

                }

 

There are two problems : the j integer is supposed to represent the y size of the array and the i to be x value.

However the .length part simply gives the full length I assume and ignores x / y positions.

And the next problem is how to position the tile(image) according to the number returned from the Array.

Thanks for any help given!

- Coly010

Posted

Thanks a_bertrand. I couldn't understand the code in for that game as it was very very disorganized but it did help me create a theory from which I googled multiple aspects of java coding and was then able to somewhat succesfully use it to tile a background.

Thanks

- Coly010

  • 6 months later...
Posted
Java is always difficult to deal with. I have been learning Java for 6 months. But now I just know little about it.

You can find some good java forums and websites for learning java. They will help you much

Posted
Java is always difficult to deal with. I have been learning Java for 6 months. But now I just know little about it.

You can find some good java forums and websites for learning java. They will help you much

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...