Hi guys. Here is a screenshot of what Ive been working on for the last few days. I'm wondering if I could create a "Camera Shake" effect for explosions such as grenades or mines. I was thinking that I would actually have to create a "camera" somehow that I could actually "shake" unless there is an easier way to achieve the desired effect?
Thanks guys!
Camera Shake? / Collisions / Enemies...
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
Camera Shake? / Collisions / Enemies...
Last edited by Ryne on Mon Nov 08, 2010 3:17 am, edited 2 times in total.
@rynesaur
- bartbes
- Sex machine
- Posts: 4946
- Joined: Fri Aug 29, 2008 10:35 am
- Location: The Netherlands
- Contact:
Re: Camera Shake?
You probably want to play with love.graphics.translate and love.graphics.rotate.
- nevon
- Commander of the Circuloids
- Posts: 938
- Joined: Thu Feb 14, 2008 8:25 pm
- Location: Stockholm, Sweden
- Contact:
Re: Camera Shake?
That looks so very, very good.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Camera Shake?
Looks great!
And such an effect is easily done with translate, as bartbes said. I use it in Space as a sign you're too close to a black hole. I think I used something like:
If you don't want the UI to shake as well, use something like:
And such an effect is easily done with translate, as bartbes said. I use it in Space as a sign you're too close to a black hole. I think I used something like:
Code: Select all
love.graphics.translate(math.random(horiz_amplitude*2)-horiz_amplitude, math.random(vert_amplitude*2)-vert_amplitude)
Code: Select all
love.graphics.push()
love.graphics.translate(math.random(horiz_amplitude*2)-horiz_amplitude, math.random(vert_amplitude*2)-vert_amplitude)
-- draw game stuff here
love.graphics.pop()
-- draw UI things here
Help us help you: attach a .love.
Re: Camera Shake?
Doing something like that would look really bad if you were doing several pixels. Every single frame. It'd look like a big blur.Robin wrote:Looks great!
And such an effect is easily done with translate, as bartbes said. I use it in Space as a sign you're too close to a black hole. I think I used something like:If you don't want the UI to shake as well, use something like:Code: Select all
love.graphics.translate(math.random(horiz_amplitude*2)-horiz_amplitude, math.random(vert_amplitude*2)-vert_amplitude)
Code: Select all
love.graphics.push() love.graphics.translate(math.random(horiz_amplitude*2)-horiz_amplitude, math.random(vert_amplitude*2)-vert_amplitude) -- draw game stuff here love.graphics.pop() -- draw UI things here
Hello, I am not dead.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Camera Shake?
Actually, not really. It works pretty well in Space, check it out. (Or fork me, whatever.)zac352 wrote:Doing something like that would look really bad if you were doing several pixels. Every single frame. It'd look like a big blur.
Help us help you: attach a .love.
Re: Camera Shake?
Can has video?Robin wrote:Actually, not really. It works pretty well in Space, check it out. (Or fork me, whatever.)zac352 wrote:Doing something like that would look really bad if you were doing several pixels. Every single frame. It'd look like a big blur.
Hello, I am not dead.
- Robin
- The Omniscient
- Posts: 6506
- Joined: Fri Feb 20, 2009 4:29 pm
- Location: The Netherlands
- Contact:
Re: Camera Shake?
Can has LÖVE. I somehow doubt that a screencast of camera shaking effects will be very interesting.
Help us help you: attach a .love.
Re: Camera Shake?
Thanks for the comments guys! I'll try this code when I get home and try to get a demo up sometime this week.
Also, for those who were curious of the random white circle, it's the cursor for the game.
Also, for those who were curious of the random white circle, it's the cursor for the game.
@rynesaur
Re: Camera Shake?
Looks fun. *waits for download*Ryne wrote:Thanks for the comments guys! I'll try this code when I get home and try to get a demo up sometime this week.
Also, for those who were curious of the random white circle, it's the cursor for the game.
Hello, I am not dead.
Who is online
Users browsing this forum: Bing [Bot] and 5 guests