Jump to content
  • Advertisement
Sign in to follow this  
prof_89

Loading maps in java

This topic is 4219 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, our game is making progress every day now.. http://www.freewebs.com/prof_89/appletgame/spel.html But as you see inte the source code (SOURCE koden) i have stored all my maps in the main program, wich is very disturbing.. I have tried to put them in a "mapsDB.class" file, in it i put the maps (int[][] map = {1,1,1,,1,1.....}... ) then i made a "public int[][] getMap1(){ return map[][];} then, in the main loop i did like this "int[][] map1 = mapDB.getMap1();" but i cant get it to work, i have tried with different methods but still it wont work, anyone that have any better ideas that works...?

Share this post


Link to post
Share on other sites
Advertisement
You only need to
return map; // no [][]
. However you'll be much better off loading the map data from file, hardcoded levels aren't very nice to work with.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by prof_89
yeah, i think i have tried it biut i will try again


anf, applets cant load data files.... or ?


they can, (should work just like loading images etc).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!