Search found 5 matches

by zac199
Tue Apr 07, 2009 12:09 am
Forum: General
Topic: Rotating image to follow mouse.
Replies: 11
Views: 10198

Re: Rotating image to follow mouse.

So would I use this same method to make the guy shoot? haha. Like I want a actual bullet that travels in a fixed direction, not your flamethrower example :P
by zac199
Mon Apr 06, 2009 3:59 pm
Forum: General
Topic: Rotating image to follow mouse.
Replies: 11
Views: 10198

Re: Rotating image to follow mouse.

Ah yes. Thanks haha. Now I just need to find were the code is that rotates the img.

EDIT:
would this be it

Code: Select all

player.direction = point_direction( player.x, player.y, love.mouse.getX(), love.mouse.getY() )
by zac199
Mon Apr 06, 2009 3:33 pm
Forum: General
Topic: Rotating image to follow mouse.
Replies: 11
Views: 10198

Re: Rotating image to follow mouse.

Haha that is a pretty nifty example, and yes thats exactly what I want to do :P. But mind telling me how to look at the script haha
by zac199
Mon Apr 06, 2009 2:21 pm
Forum: General
Topic: Rotating image to follow mouse.
Replies: 11
Views: 10198

Re: Rotating image to follow mouse.

Sort of... I have a image that moves with W,A,S,D, and I want the... err front so to say to always look at the mouse.

If you dont know what i mean, Im making a top down shooter, and I need to be able to aim haha.
by zac199
Mon Apr 06, 2009 2:04 pm
Forum: General
Topic: Rotating image to follow mouse.
Replies: 11
Views: 10198

Rotating image to follow mouse.

Hi :)

I was wondering how I could get my image to follow my mouse.

Like have the front of the image always looking at the mouse on the screen.

Just a quick question :) thanks ahead of time.