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!
Brady- A Camera Library with Parallax Scrolling
Brady- A Camera Library with Parallax Scrolling
- Attachments
-
- Squares.love
- v0.3.1
- (16.04 KiB) Downloaded 529 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
Re: Brady- A Camera Library with Parallax Scrolling
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.
Not bad, the code seems straight forward.
Regarding point transformations, I usually prefer to use an external module, but your approach is fine.
- 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
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.
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.
Re: Brady- A Camera Library with Parallax Scrolling
@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
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?
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
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
- 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
How many do you want?davisdude wrote:Does anyone have any other recommendations?
When I write def I mean function.
Re: Brady- A Camera Library with Parallax Scrolling
lead, lerp, follow styles/deadzones, you can see an example of those here http://haxeflixel.com/demos/FlxCamera/
- 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
The demo is fun
PS: keypresses displayed by key-mon
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)
-- Don't force fullscreen (it frustrates those who want to try your game real quick) -- Develop for 1280x720 (so people can make HD videos)
Re: Brady- A Camera Library with Parallax Scrolling
Version 0.2.0 has been released:
- Removed metatable from _G
- Updated and edited README.md
- Removed metatable from _G
- Updated and edited README.md
Thanks! Personally, I like to rotate and make all sorts of loopsqubodup wrote:The demo is fun
I'll have to check those out!adnzzzzZ wrote:lead, lerp, follow styles/deadzones, you can see an example of those here http://haxeflixel.com/demos/FlxCamera/
Good thing I have a break coming up! That's quite a bit of suggestions...kikito wrote:How many do you want?
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
Re: Brady- A Camera Library with Parallax Scrolling
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!
- :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
Re: Brady- A Camera Library with Parallax Scrolling
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
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
Who is online
Users browsing this forum: No registered users and 2 guests