Pura java scrolling background with Tiledmap type based game/engine

Heres my topic of the day, I could of looked harder but its cool to keep in touch here with everyones wicked responses.

I’m using a notch style PJ engine, I’m working on the tilemap class which works with external txt files for tile maps… which is based on Foreign Guy Mike type code

It’s 20 x 15, now how would I create a camera to move with the player for instance? I know this is pretty simple with LibGDX which is what I’ve been hammering for the last few weeks but have decided to move back to PJ for a while as I got a bit lost with LibGDX and feel I need to work on my Java skills for a while before moving on to bigger and more complex external libraries, just a personal thing.

I want to keep this pixelated though, like scaled. As I’m a massive fan of the pixel look which is something I can do from lots of tutorials I’ve been through

I’m just stuck on how I would implement a kind of a camera with a tilebased game, if this is a complex question and would take a while to explain, if you could explain for instance, how I would move a camera maybe 60 tiles wide, and kept at 15 tiles high.

Thanks and big love to the JGO newb crew

Hi

If you get lost with LibGDX, how can you feel able to write an engine? Instead of being stuck on anything, shouldn’t you stick to LibGDX?

Your right, but with LibGDX the cam stuff has plenty of functions to manipulate it but with PJ it’d require to write your own code.

Stuck as in, limited to what I can do and learn. I’ve mentioned this before and its difficult to get the message across on text, I’m not really into gaming - hardly play games unless I see people on here who’ve made them which makes me keen to check out, I’m more into the technical side on how they work hence the question on software rendering cameras.

Now, you may think, just use LWJGL library then, which is what I usually get from responses. That has cams to which I’ve run into, scalling resolutions by keeping the window size with the viewport, flipping the camera, moving the camera. But PJ to me, alone is a excellent language which is a hobbie aimed towards a Java career in the future along with taking in turns servlets, jsp, mysql etc, hence learning all the technical bits using just this language without having to worry about hardware level GPU stuff and be able to run on things from what I’ve learned on the language with Rasberry PI, or simular smaller homebrew type PC’s - Yeah they have light versions opengl but I’m repeating myself again.

I am into OpenGL dont get me wrong but my post was on how to create some camera to move left with the player

I understand that you want to learn. I implemented something similar but with a single image in Python about ten years ago. Good luck.

Sussed it kind of, but got lots of errors on other stuff

	// move the map
		tileMap.setx((int) (Game.WIDTH / 2 - x));
		tileMap.sety((int) (Game.HEIGHT / 2 - y));