Brady- A Camera Library with Parallax Scrolling

Showcase your libraries, tools and other projects that help your fellow love users.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Verson 0.3.1 is out! This version includes :adjustScale and :adjustPosition (admittedly, based off of Kikito's gamera). Check out the newest demo to test it out.

Hello all! I've been working hard on a camera library with parallax scrolling, and I think it's finally presentable.
Check it out here.
Please try out the demo and let me know what you think! :)
Attachments
Squares.love
v0.3.1
(16.04 KiB) Downloaded 487 times
Last edited by davisdude on Sun Apr 05, 2015 3:11 am, edited 3 times in total.
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: Brady- A Camera Library with Parallax Scrolling

Post by ivan »

At first I thought this was a Computerphile/periodic videos reference... reading the docs I see you meant the Civil war photographer. :)
Not bad, the code seems straight forward.
Regarding point transformations, I usually prefer to use an external module, but your approach is fine.
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Brady- A Camera Library with Parallax Scrolling

Post by kikito »

This is not bad, but I will definitively and absolutely recommend getting rid of the manipulation of _G.

The user already can get the layers when doing newLager and getLayer; it's not that losing the _G would suppose a great sacrifice. On the other hand, there are plenty of drawbacks.

Here's one example: imagine what would happen if another library (say, a sound library) also modified _G. People would have to choose between using your camera system or the sound system, because they are not compatible (or worse, they are compatible but break each other in subtle ways).

The extra "comfort" of being able to use the layer names directly is a very bad tradeoff.
When I write def I mean function.
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

@ivan:
Thanks for the kind words! Your coordinate method is very advanced to.
I had not heard of Computerphile Brady, but some of his videos do look interesting...

@kikito:
I had not thought about multiple libraries modifying _G, although I guess I'm not the only person allowed to modify _G :P
You're right, of course- using the returned variables does make a lot more sense. I'll probably push an update some time this afternoon.

In the meanwhile I'll be trying to think of some useful functions that I can add.
So far, I've got:
- screenShake( intensity, duration ) -- or should it be duration, intensity?
- Some function to clamp the camera's scale/rotation/etc. to the map (this would also need you to define "world" size).

Does anyone have any other recommendations?
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
User avatar
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Location: Madrid, Spain
Contact:

Re: Brady- A Camera Library with Parallax Scrolling

Post by kikito »

davisdude wrote:Does anyone have any other recommendations?
How many do you want? :rofl:
When I write def I mean function.
User avatar
adnzzzzZ
Party member
Posts: 305
Joined: Sun Dec 26, 2010 11:04 pm
Location: Porto Alegre, Brazil

Re: Brady- A Camera Library with Parallax Scrolling

Post by adnzzzzZ »

lead, lerp, follow styles/deadzones, you can see an example of those here http://haxeflixel.com/demos/FlxCamera/
User avatar
qubodup
Inner party member
Posts: 775
Joined: Sat Jun 21, 2008 9:21 pm
Location: Berlin, Germany
Contact:

Re: Brady- A Camera Library with Parallax Scrolling

Post by qubodup »

The demo is fun :)


PS: keypresses displayed by key-mon
lg.newImage("cat.png") -- made possible by lg = love.graphics
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Version 0.2.0 has been released:
- Removed metatable from _G
- Updated and edited README.md
qubodup wrote:The demo is fun :)
Thanks! Personally, I like to rotate and make all sorts of loops :D
adnzzzzZ wrote:lead, lerp, follow styles/deadzones, you can see an example of those here http://haxeflixel.com/demos/FlxCamera/
I'll have to check those out!
kikito wrote:How many do you want? :rofl:
Good thing I have a break coming up! That's quite a bit of suggestions... :shock:
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
davisdude
Party member
Posts: 1154
Joined: Sun Apr 28, 2013 3:29 am
Location: North Carolina

Re: Brady- A Camera Library with Parallax Scrolling

Post by davisdude »

Update! Version 0.3.1 is released! This includes features such as:
- :setWorld
- :adjustScale
- :adjustPosition
(last two heavily based off of Kikito's work...)

More features are planned, so stay tuned! :)
GitHub | MLib - Math and shape intersections library | Walt - Animation library | Brady - Camera library with parallax scrolling | Vim-love-docs - Help files and syntax coloring for Vim
Fantos
Prole
Posts: 11
Joined: Sat Aug 08, 2015 9:22 am

Re: Brady- A Camera Library with Parallax Scrolling

Post by Fantos »

Hi there, I have a problem with your library. I change from gamera to this library, and after setup the camera I got this:
PICTURE
That blue box ( what I get with cam:getVisible) exactly what I need the camera to see, but for some reason it show the whole map, like adjustScale do nothing, and I don't know anymore whats going on with the camera. Here the lua code where I try to use the camere:LINK
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 34 guests