Pointing an image

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Jasoco
Inner party member
Posts: 3651
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Pointing an image

Taehl wrote:You mean, math.pi*.5, right? Rotating by 90 radians would be like rotating by 5156 degrees...
Sorry, I think in degrees. So I usually convert my degree numbers to radians. Yes, 90 degrees would be half pi. 180 would be pi. And 270 would be pi and a half. 360 would be 0 or two pi... mmm... I wish I had 2 pi's...

BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Pointing an image

Code: Select all

math.tau = math.pi * 2
math.tau -- 360 or 0 deg
math.tau / 2 -- 180
math.tau / 4 -- 90
math.tau / 8 -- 45
-- and so on...
It's easy to remember because if you replace math.tau with 1 in your head, that's the fraction of a circle you get.

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

Re: Pointing an image

I knew you'd say that when I read Jasoco's post.

Jasoco
Inner party member
Posts: 3651
Joined: Mon Jun 22, 2009 9:35 am
Location: Pennsylvania, USA
Contact:

Re: Pointing an image

I still prefer to use degrees.

BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Pointing an image

Robin wrote:
I knew you'd say that when I read Jasoco's post.
Ha ha, but what's wrong with Tau? It's better than Pi (and hey, you get twice as much pie too! ).

Taehl
Dreaming in associative arrays
Posts: 1024
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: Pointing an image

I prefer pi (that is to say, radians) to tau, degrees, quaternions, or anything else.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.

BlackBulletIV
Inner party member
Posts: 1261
Joined: Wed Dec 29, 2010 8:19 pm
Location: Queensland, Australia
Contact:

Re: Pointing an image

Why's that? I'm interested to know. How is $\frac{\pi}{2}$ to make a quater circle more logical than $\frac{\tau}{4}$?

Anxiety
Prole
Posts: 49
Joined: Sat Apr 02, 2011 9:36 am
Location: Finland

Re: Pointing an image

And yet again, more problems. Now the characters face isnt looking at the mouse, but the characters top left corner is.

And just for you to see it, heres the .love file.
Attachments
CharMoving.love
I can't come up with a good signature!

Anxiety
Prole
Posts: 49
Joined: Sat Apr 02, 2011 9:36 am
Location: Finland

Re: Pointing an image

I got it working by using the love.graphics.draw function's offset x and offset y.

Thanks guys!
I can't come up with a good signature!

BarnD
Prole
Posts: 49
Joined: Wed Jun 16, 2010 1:23 pm
Location: Australia
Contact:

Re: Pointing an image

Anxiety wrote:I got it working by using the love.graphics.draw function's offset x and offset y.
I was just about to say that, but then you edited the post.
Cause im making a game, which is so far basically like yours, and I did that too.

Who is online

Users browsing this forum: Google [Bot], slime and 16 guests