small "shaky-cam" effect

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.
User avatar
Ryne
Party member
Posts: 444
Joined: Fri Jan 29, 2010 11:10 am

Re: small "shaky-cam" effect

Post by Ryne » Thu Dec 22, 2011 5:51 am

osgeld wrote:ahh new lovers ...

your overwriting the original values with the ones provided in the formula, = overwrites

so maybe (without looking at a single bit of code...)

camera.x = camera.x + (camera.xmag * math.sin(camera.time * camera.speed * 2))
camera.y = camera.y + (camera.ymag * math.sin(camera.time * camera.speed))

?
I'm not THAT new. It's pretty late right now, tired as all hell. I didn't even look at that line of code..
@rynesaur

User avatar
Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

Re: small "shaky-cam" effect

Post by Robin » Thu Dec 22, 2011 11:08 am

Oh yeah, I assumed you didn't use camera.x and camera.y for something else.

A better way of dealing with it would be to set camera.shakex and camera.shakey and translate the camera by (camera.x + camera.shakex, camera.y + camera.shakey) instead of (camera.x, camera.y).
Help us help you: attach a .love.

User avatar
osgeld
Party member
Posts: 303
Joined: Sun Nov 23, 2008 10:13 pm

Re: small "shaky-cam" effect

Post by osgeld » Thu Dec 22, 2011 11:20 pm

I'm not THAT new.
yea I know, I did it partly to rattle your cage a bit :huh:

Post Reply

Who is online

Users browsing this forum: No registered users and 40 guests