🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

[java] I have problems with creating engine.

Started by
0 comments, last by Arch@on 24 years, 5 months ago
I''m creating engine on standalone, but I have found some problems in drawing images. I probably need some sort of component because drawing on the window is so freaking limited(I suppose with my experience) Any good suggestions? (It''s tile based scrolling engine and personal charachter is in the middle of it) Also, should i draw the whole map at time or just the point of view position and then load map all the time? I suppose first one is faster once it has loaded.
Advertisement
Have you taken a look at my "GameFrame for Java" library? You can find it from:
http://www.gamedev.net/hosted/javanerd/
and it provides many things that are needed for 2D game programming.

You shouldn''t draw the whole map at a time, but you should have the 2D array representing the tiles loaded all the time (if you aren''t using HUGE tile maps that take up tens of megabytes of memory) and draw parts of that instead.

You didn''t mention do you want to move the character with jumps from one tile to another or smoothly pixel by pixel.
I''ll take the latter one as an example.

You need an offscreen image that is larger than you display size. You draw the tiles from the map data to that image (using some offsets to the map data) and use the image to draw the map on to the screen. By changing the drawing offset of the image you can smoothly scroll that piece of map on the screen and when the player moves enough pixels to count as one tile you just change the offset to the map data accordingly and redraw the image using tiles and reset the image drawing offsets.
-Pasi Keranen

This topic is closed to new replies.

Advertisement