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!
Last edited by Ryne on Mon Nov 08, 2010 3:17 am, edited 2 times in total.
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:
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
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:
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
Doing something like that would look really bad if you were doing several pixels. Every single frame. It'd look like a big blur.