Camera Script Not Working.

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.
Post Reply
Ethan-Taylor
Prole
Posts: 34
Joined: Mon Nov 24, 2014 9:15 pm

Camera Script Not Working.

Post by Ethan-Taylor »

Hey guys,
The following code doesn't quite work for the camera script located from 118 - 152 in main.lua.
I've used a cursor follow script that micha gave me a while ago, it doesn't quite work with the camera.
Any help?

Thanks, and sorry for spamming you with questions XD
Attachments
KillEverybody.love
(44.55 KiB) Downloaded 103 times
User avatar
vladgalay
Citizen
Posts: 60
Joined: Sun Jan 29, 2012 4:54 pm
Location: The Motherland

Re: Camera Script Not Working.

Post by vladgalay »

I think i fixed it. I just changed lines 45 and 46 from this:

Code: Select all

rotcalc.x = love.mouse.getX() - movement.x
rotcalc.y = love.mouse.getY() - movement.y
To this:

Code: Select all

rotcalc.x = love.mouse.getX() + camera.x - movement.x
rotcalc.y = love.mouse.getY() + camera.y - movement.y
The file is in attachment
Attachments
KillEverybody_corrected.love
(44.58 KiB) Downloaded 171 times
Ethan-Taylor
Prole
Posts: 34
Joined: Mon Nov 24, 2014 9:15 pm

Re: Camera Script Not Working.

Post by Ethan-Taylor »

vladgalay wrote:I think i fixed it. I just changed lines 45 and 46 from this:

Code: Select all

rotcalc.x = love.mouse.getX() - movement.x
rotcalc.y = love.mouse.getY() - movement.y
To this:

Code: Select all

rotcalc.x = love.mouse.getX() + camera.x - movement.x
rotcalc.y = love.mouse.getY() + camera.y - movement.y
The file is in attachment
Thanks, It works :D
Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 3 guests