Go Back   Java Programming Forums > Java Standard Edition Programming Help > Collections and Generics


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-02-2010, 09:45 PM
Junior Member
 

Join Date: Feb 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
chuckgod53 is on a distinguished road
Default tile map help

Hello! I am currently working a game in Java. The only thing is i do not know how to use or implement tile maps. If anyone knows how to or where to learn this please let me know thanks!!!



Reply With Quote Share this thread on Facebook
Sponsored Links
Java Training from DevelopIntelligence
  #2 (permalink)  
Old 10-02-2010, 04:17 PM
helloworld922's Avatar
Super Moderator
 

Join Date: Jun 2009
Posts: 1,329
Thanks: 5
Thanked 282 Times in 254 Posts
helloworld922 will become famous soon enoughhelloworld922 will become famous soon enoughhelloworld922 will become famous soon enough
Default Re: tile map help

A tile map is an array of values that represents what's at that location. All you need to do is specify a 2D array and store a bunch of values that each represent a different type of tile. Ex:

0 = empty ground
1 = water
2 = rock

1 1 1 1 1 1 1 1 1 1
1 0 0 0 2 0 0 0 0 1
1 0 0 0 2 0 0 0 0 1
1 0 0 0 2 0 0 0 0 1
1 0 0 0 0 0 0 0 0 1
1 0 0 0 2 0 0 0 0 1
1 0 0 0 2 0 0 0 0 1
1 0 0 0 2 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1

This will look like a wall of rocks with a hole you can get through.
__________________
ASCII a question .. Get an ANSI

Please surround your code with [highlight=Java]code goes here[/highlight].
Reply With Quote
Reply

Tags
game, map, sprites, tile, tilemap

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




100 most searched terms
Search Cloud
2d arraylist java actionlistener actionlistener in java actionlistener java addactionlistener addactionlistener in java addactionlistener java applications of oops could not create java virtual machine xp double format java double to int double to int java double to integer in java double to integer java eclipse shortcut keys eclipse tutorial for beginners exception in thread "awt-eventqueue-0" java.lang.outofmemoryerror: java heap space exception in thread "main" java.lang.nullpointerexception exception in thread "main" java.lang.outofmemoryerror: java heap space format double java get mouse position java java 2d arraylist java actionlistener java addactionlistener java convert list to map java double format java double formatting java double to int java double to integer java format double java forum java forums java get mouse position java list to map java mouse position java programming forum java programming forums java programming help java sendkeys java two dimensional arraylist java.lang.classformaterror: truncated class file java.lang.outofmemoryerror: java heap space java.util.arraylist jbutton actionlistener jtextarea font jtextfield font size jxl.read.biff.biffexception: unable to recognize ole stream programming mutators and generics two dimensional arraylist java writing ipod apps

All times are GMT. The time now is 07:32 AM.
Powered by vBulletin® Copyright ©2000-2009, Jelsoft Enterprises Ltd.