Hi !
Featured games (88)
games approved by the League of Dukes
Games in Showcase (681)
Games in Android Showcase (196)
games submitted by our members
Games in WIP (744)
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  
  scrolling tiled map  (Read 1763 times)
0 Members and 1 Guest are viewing this topic.
Offline mc_java

Junior Newbie

Java games rock!

« Posted 2004-12-18 22:43:18 »

for my final project im thinking of making a 2d tiled map game. i plan to have this map scrollable becuase the game map will be very large.

Do you guys think putting this map on a JPanel and then putting it into a JScrollPane would make this map scoll fast enough?

Also with this map is it nessary to use a buffer?
Offline DrBizzar0

Junior Devvie

Raj raj!

« Reply #1 - Posted 2004-12-19 06:38:19 »

That depends on what kind of game you'll make. If it's a strategy game with not that much animations and scrollings going on for example, then I see no problems in using Swing. See JFreeRails for an example of this:

But if you are planning to make a fast paced action game with lots of scrolling and animations going on you'd be better of using BufferStrategy to draw the tiles onto the screen.

A simple sollution would be to create an int matrix which symbolizes the tiled map, an array of BufferedImages that the matrix int links to and a x and y int that tells which matrix position currently should be painted to the upper left corner of the game window.
Offline JuddMan

Senior Devvie

Medals: 1

Your Ad Here

« Reply #2 - Posted 2004-12-19 07:55:14 »

anything that involves stuff moving around onscreen while the scrolling is happening will not be too smooth... for something where the scrolling is just a means of looking at another area and most of the action takes place with the view point still, this sort of thing is not too bad, but bufferStrategy is really the better option inthe long run.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mc_java

Junior Newbie

Java games rock!

« Reply #3 - Posted 2004-12-19 17:10:50 »

thx for the replies, so far i've made an array of images taht will be drawn onto a buffer then its copied to a jPanel which is on a JScrollPane and when i scroll its reallllllly sloooow...

this map is simiar to civilization, there arent any animation at all just images of terrain. i dont understand why its so sloww

is there sth that im doing wrong?
Offline DrBizzar0

Junior Devvie

Raj raj!

« Reply #4 - Posted 2004-12-20 04:49:07 »

I really don't have any experience of using a JPanel and JScrollPane for games so I can't give you hints on that. But JFreeRails does it succesfully and the source is available, so you could take a look on that source and find out how it is done there.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Hydroque (43 views)
2016-06-22 02:17:53

SwampChicken (45 views)
2016-06-20 13:22:57

SwampChicken (44 views)
2016-06-20 13:22:49

SwampChicken (38 views)
2016-06-20 13:22:26

Hydroque (81 views)
2016-06-15 08:22:50

Hydroque (72 views)
2016-06-13 06:40:55

DarkCart (192 views)
2016-05-29 02:30:33

Hydroque (160 views)
2016-05-26 14:45:46

Mac70 (168 views)
2016-05-24 21:16:33

theagentd (151 views)
2016-05-14 18:38:35
Java Data structures
by BinaryMonkL
2016-06-13 21:22:09

Java Data structures
by BinaryMonkL
2016-06-13 21:20:42

FPS Camera Tutorial
by Hydroque
2016-05-22 05:40:58

Website offering 3D Models specifically for games for free
by vusman
2016-05-18 17:23:09

Website offering 3D Models specifically for games for free
by vusman
2016-05-09 08:50:56

Website offering 3D Models specifically for games for free
by vusman
2016-05-06 11:10:21

Website offering 3D Models specifically for games for free
by vusman
2016-04-29 12:56:17

List of Learning Resources
by SilverTiger
2016-02-05 09:39:47 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!