Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (756)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Creating a Map  (Read 1891 times)
0 Members and 1 Guest are viewing this topic.
Offline Vladiedoo
« Posted 2012-05-06 19:33:08 »

Hi, I'm currently making a top down shooter with Java 2D (I just ordered a Slick2D book so I'll start learning the better libraries soon). I need to make a map that moves with the player once the player gets too far away from the center position, I was wondering how I should go about doing this?

Keep in mind I have yet to program collision detection into my game, but I also want my map to eventually have destructible walls. Do I want to...
  • Create a map using a tile system?
  • Draw a really big image and move it around?
  • Or some other form of making a map?

Sorry for spamming this section of the forum x), all help is greatly appreciated! (I've gotten a lot done thanks to the help from this forum, so an additional thanks for the help I've already gotten).
Offline matheus23

JGO Kernel

Medals: 138
Projects: 3

You think about my Avatar right now!

« Reply #1 - Posted 2012-05-06 19:38:54 »

You should go with a tile system. As (if you want to use it later) using OpenGL, will only allow you up to 4096x4096 pixel Images. Also, loading these Images can cost a lot of VRAM.

Just create a class "Tile" and a class "Map", holding a 2D-Array of "Tile"s. Then just render all tiles visible Smiley

See my:
    My development Blog:     | Or look at my RPG | Or simply my coding
http://matheusdev.tumblr.comRuins of Revenge  |      On Github
Offline davedes
« Reply #2 - Posted 2012-05-06 19:51:58 »

Why wait for the book? Slick is very easy to jump into, probably much easier than writing your own game loop, tiled map loader, and so forth in Java2D. You'll generally find it more efficient at rendering, and using an OpenGL-based library will force you to learn various game development standards (i.e. thinking about textures in power-of-two, using texture atlases, etc).

There are examples of map loading and scrolling like this one:

And there's lots of resources in the wiki and on the forum.

Pages: [1]
  ignore  |  Print  

DesertCoockie (53 views)
2018-05-13 18:23:11

nelsongames (85 views)
2018-04-24 18:15:36

nelsongames (75 views)
2018-04-24 18:14:32

ivj94 (760 views)
2018-03-24 14:47:39

ivj94 (91 views)
2018-03-24 14:46:31

ivj94 (644 views)
2018-03-24 14:43:53

Solater (103 views)
2018-03-17 05:04:08

nelsongames (186 views)
2018-03-05 17:56:34

Gornova (427 views)
2018-03-02 22:15:33

buddyBro (1087 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!