Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (495)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 1399 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 Member




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:

http://freerails.sourceforge.net/
http://freerails.sourceforge.net/jfreerails.jnlp

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 Member


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 Member




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.

 

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

The first screenshot will be displayed as a thumbnail.

BurntPizza (14 views)
2014-09-19 03:14:18

Dwinin (32 views)
2014-09-12 09:08:26

Norakomi (58 views)
2014-09-10 13:57:51

TehJavaDev (80 views)
2014-09-10 06:39:09

Tekkerue (40 views)
2014-09-09 02:24:56

mitcheeb (62 views)
2014-09-08 06:06:29

BurntPizza (45 views)
2014-09-07 01:13:42

Longarmx (31 views)
2014-09-07 01:12:14

Longarmx (37 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!