Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (475)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (530)
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  
  [noob] hows a "map" like?  (Read 1177 times)
0 Members and 1 Guest are viewing this topic.
Offline fermixx

Senior Newbie





« Posted 2009-08-15 05:56:40 »

Hi,

im pretty new at game development, so this is beyond java programming.

I was wondering about how's the general structure of a map in a normal 2d platform game.

The specific questions are:

1º regardin the image, is it a very wide image and you just print the part that is inside the frame? how do you handle de coords of everything?

2º how do you implement the ground or walls? i heard about tile maps divided in cells, and each cell is either "air" or "solid" but, if you need high precision, i guess you need a really big array of bools, i mean, REALLY big. is that true?

3º how do you place objects and or enemies that are outside the screen? you just set their x to be outside the display area? (e.g. you have a 1024x640 frame, so you place the enemy at 2048. But, when your character moves, what happens?




Im a really newbie in game programming and i just dont imagine how things are. Besides that, all tutorials talk about games like arcanoid, tetris and SPACE INVADERS, but none of them about a game which involves solid and not solid objects (and maps bigger than the actual display size).

If anyone has a mario-style tutorial or code of a rip off (that would be cool) it would be the perfect answer for my questions, and a great help too.


I dont want the exact algorithm, just something explanatory to have a brief idea of how its like.


thank you in advance

fermin

RTS game or a big rock-paper-sissors ?
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #1 - Posted 2009-08-15 08:00:44 »

To try to answer some of your questions...

1) The screen is typically drawn as tiles. You can simply have a data structure with the type of tile at each location.

2) The simplest form is a tile is either movable or not. The next step is probably supporting a square tile with a triangle shape (from corner to corner).

3) Objects outside the viewport are not drawn. When the character moves, the map and any objects are redraw to show the new location.

On very large maps some tricks can be done, like not running the AI for an enemy that is very far away. When the player gets close enough, but with the enemy still not on screen, then you would run the AI.

You might look at Slick and TilED.

Demo of tilemap with Slick:
http://slick.cokeandcode.com/demos/tilemaptest.jnlp

More interesting, scrollable tilemap:
http://slick.cokeandcode.com/demos/scroller.jnlp

TilED editor:
http://mapeditor.org/tiled.jnlp

TilED homepage:
http://www.mapeditor.org

Offline Renoria

Junior Member




...


« Reply #2 - Posted 2009-08-15 09:10:36 »

what I use is an ArrayList of line segments as platforms. That way I can have sloped tiles in any direction I want. Good luck
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Nate

JGO Kernel


Medals: 145
Projects: 4
Exp: 14 years


Esoteric Software


« Reply #3 - Posted 2009-08-26 09:44:01 »

2) The simplest form is a tile is either movable or not. The next step is probably supporting a square tile with a triangle shape (from corner to corner).
Found this and thought of my post here.
http://www.tonypa.pri.ee/tbw/tut24.html

Offline fermixx

Senior Newbie





« Reply #4 - Posted 2009-08-27 10:09:22 »

i was reading that some time ago, if im not wrong it was with actionscript. its pretty similar though.

im gonna read it a bit more when i have time.

if its you who wrote the tutorial, thanks for sharing Smiley, finally a non space-invaders tutorial !!

RTS game or a big rock-paper-sissors ?
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

ctomni231 (32 views)
2014-07-18 06:55:21

Zero Volt (28 views)
2014-07-17 23:47:54

danieldean (24 views)
2014-07-17 23:41:23

MustardPeter (25 views)
2014-07-16 23:30:00

Cero (40 views)
2014-07-16 00:42:17

Riven (42 views)
2014-07-14 18:02:53

OpenGLShaders (29 views)
2014-07-14 16:23:47

Riven (29 views)
2014-07-14 11:51:35

quew8 (27 views)
2014-07-13 13:57:52

SHC (63 views)
2014-07-12 17:50:04
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
java-gaming.org 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‑gaming.org
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!