Advanced Tile Loader + camera

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
luaz
Citizen
Posts: 83
Joined: Sun Sep 16, 2012 2:55 pm

Advanced Tile Loader + camera

Post by luaz »

While I understand the general concept how a "camera" should work, I do not understand how to implement it with Advanced Tile Loader. How to "tie" them together, so that the collision would work and the player's movement would be synchronized with the map's scrolling.
If you're going to reply to my post, consider posting an (preferably working) example - 99.7% of time time, I already know how to implement the feature theoretically! ;) I don't learn very well from references, etc....
User avatar
Roland_Yonaba
Inner party member
Posts: 1563
Joined: Tue Jun 21, 2011 6:08 pm
Location: Ouagadougou (Burkina Faso)
Contact:

Re: Advanced Tile Loader + camera

Post by Roland_Yonaba »

Well, a bit of searching can bring you answers.
Did you go through the examples of use for AdvTiled Loader ?
See Desert_Example, watch out global.tx/global.ty variables, and the push(), translate() and pop() methods.
This tutorial on cameras should help, too.
luaz
Citizen
Posts: 83
Joined: Sun Sep 16, 2012 2:55 pm

Re: Advanced Tile Loader + camera

Post by luaz »

Roland_Yonaba wrote:Well, a bit of searching can bring you answers.
Did you go through the examples of use for AdvTiled Loader ?
See Desert_Example, watch out global.tx/global.ty variables, and the push(), translate() and pop() methods.
This tutorial on cameras should help, too.
I did. I can scroll the camera with set keys, but I want it to scroll with the player. That's the point of this thread - I cannot tie them together, the player AND the tilemap.
If you're going to reply to my post, consider posting an (preferably working) example - 99.7% of time time, I already know how to implement the feature theoretically! ;) I don't learn very well from references, etc....
SudoCode
Citizen
Posts: 61
Joined: Fri May 04, 2012 7:05 pm

Re: Advanced Tile Loader + camera

Post by SudoCode »

Update the camera position each frame to playerX and playerY.
User avatar
dreadkillz
Party member
Posts: 223
Joined: Sun Mar 04, 2012 2:04 pm
Location: USA

Re: Advanced Tile Loader + camera

Post by dreadkillz »

There are camera libs that you can check out from searching. If you don't want to use them, check their codes to get an idea of how it works.
luaz
Citizen
Posts: 83
Joined: Sun Sep 16, 2012 2:55 pm

Re: Advanced Tile Loader + camera

Post by luaz »

I got it working... But I have no idea why it works, it seems as if there's something either missing or too much.

Well, if something won't work, I'll ask for help with my code then. For now, I'm okay with this.
If you're going to reply to my post, consider posting an (preferably working) example - 99.7% of time time, I already know how to implement the feature theoretically! ;) I don't learn very well from references, etc....
Post Reply

Who is online

Users browsing this forum: BrotSagtMist, darkfrei, Google [Bot] and 78 guests