Gornova / MarteEngine

MarteEngine is a Java Engine for videogames
http://randomtower.blogspot.com
Other
74 stars 20 forks source link

Camera tutorial? And camera debug display? #45

Closed flowstate closed 13 years ago

flowstate commented 13 years ago

I'm trying to set up my camera to be like Fuzzy's, and I'm having a lot of trouble. I'm using a scalablegame, and when I load a map, the camera's not centered on the map, nor the player, and I get no vertical scroll whatsoever, so that the player can fall off camera, while still being within the map.

I think I'd be able to reason my way through how the system works, except that I have no idea how you did the camera box debug display in fuzzy alpha 2. I looked for the render code, but I couldn't find that.

Any help on this would be great. And if someone could explain to me how the camera works, I will make the tutorial myself, I just need a little guidance.

Gornova commented 13 years ago

sorry, last code of fuzzy alpha 2 is not on github, my fault, I will put on it as soon I can

flowstate commented 13 years ago

Awesome Gornova, I would appreciate that so much. Like I said, as soon as I can reason out how to do it, I'll write up a tutorial. Thanks!!

Gornova commented 13 years ago

I've pushed right now on dev branch all my code, please check it!

flowstate commented 13 years ago

Hmm, I'm not seeing an update from you. I see one from Tommy a day ago, but maybe I'm just not looking in the right spot. I'll keep looking around.

Edit: I see now that ME has been changed to display hitboxes. Is that where the code happens to display the rectangle for the camera? I guess maybe I should just ask a question on the forums, because my camera is acting very very strange. It doesn't center on the tiledMap nor on the player (which is being passed as 'Entity follow' to the camera).

I'm not at home for the next couple days, when I get there, I'll try out this code.

I'm just not seeing a new version of fuzzy on the dev branch.

Gornova commented 13 years ago

I've checked again, all my code is on github :d try again and let me know if you can see new camera :D

Gornova commented 13 years ago

flowstate, can you provide some feedback about that?

flowstate commented 13 years ago

Sorry about the long delay. Okay, the problem that I was having was in displaying the camera rectangle, and the fact that I was using a scalable game. I will post the solution to that in the correct issue.

I see the code, it works correctly, thanks sir! Once I implement the camera doing something significantly different than yours, I'll post a tutorial.

Gornova commented 13 years ago

good, thanks to u!