[SOLVED]Help: making a square follow the mouse pointer

General discussion about LÖVE, Lua, game development, puns, and unicorns.
Post Reply
User avatar
nice
Party member
Posts: 191
Joined: Sun Sep 15, 2013 12:17 am
Location: Sweden

[SOLVED]Help: making a square follow the mouse pointer

Post by nice »

Hello boys and girls!

I need some help with making a square (16x16) follow the mouse pointer, I would appreciate if you could make your explanations detailed.
My project that I'm making (a MS paint clone that I call Helium) is part of my process/project to better understand Lua and it's functions and this project (Helium) is part of the graphical part of Löve.
I have loked around on the Löve forum and other forums for threads that could help me but I haven't found any that helps.

I will attach my project file and I will also make able for you to view my "step by step" goals with this project and feel free to suggest anything that I should add or skip on this project.

I thank you for your time!
Attachments
Helium description and goals.doc
Project description and goals
(16.5 KiB) Downloaded 151 times
main.lua
The project
(639 Bytes) Downloaded 77 times
Last edited by nice on Tue Sep 09, 2014 4:17 pm, edited 1 time in total.
:awesome: Have a good day! :ultraglee:
User avatar
Plu
Inner party member
Posts: 722
Joined: Fri Mar 15, 2013 9:36 pm

Re: Help: making a square follow the mouse pointer

Post by Plu »

Making the square display on the location of the mouse cursor is as simple as doing this:

Code: Select all

-- Draws A 16x16 Square
love.graphics.rectangle("line", x, y, 16, 16)
User avatar
nice
Party member
Posts: 191
Joined: Sun Sep 15, 2013 12:17 am
Location: Sweden

Re: Help: making a square follow the mouse pointer

Post by nice »

Plu wrote:Making the square display on the location of the mouse cursor is as simple as doing this:

Code: Select all

-- Draws A 16x16 Square
love.graphics.rectangle("line", x, y, 16, 16)
So I dosen't need a local statement?
:awesome: Have a good day! :ultraglee:
User avatar
nice
Party member
Posts: 191
Joined: Sun Sep 15, 2013 12:17 am
Location: Sweden

Re: Help: making a square follow the mouse pointer

Post by nice »

Nevermind, I see it's not needed.
Thanks for your help!
:awesome: Have a good day! :ultraglee:
Post Reply

Who is online

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