Coly010 Posted May 21, 2012 Share Posted May 21, 2012 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 Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted May 21, 2012 Share Posted May 21, 2012 Why not check how others do it? http://mystikrpg.com/ Quote Link to comment Share on other sites More sharing options...
Coly010 Posted May 21, 2012 Author Share Posted May 21, 2012 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 Quote Link to comment Share on other sites More sharing options...
Gary_C Posted November 29, 2012 Share Posted November 29, 2012 Java is always difficult to deal with. I have been learning Java for 6 months. But now I just know little about it. Quote Link to comment Share on other sites More sharing options...
CATHERINE Posted December 3, 2012 Share Posted December 3, 2012 Yes, it takes time and patience! Quote Link to comment Share on other sites More sharing options...
abigale Posted December 5, 2012 Share Posted December 5, 2012 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 Quote Link to comment Share on other sites More sharing options...
abigale Posted December 5, 2012 Share Posted December 5, 2012 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.