Search found 105 matches

by PGUp
Sat Apr 29, 2017 2:25 am
Forum: General
Topic: atan2 problem
Replies: 2
Views: 1199

atan2 problem

hi, so i have a problem with atan2, i want to make my rectangle to face mouse and rotate towards it, i try to use atan2, but it didnt work, it shows a very weird movement instead, (in the update function) angle = angle + math.atan2(y - love.mouse.getY, love.mouse.getX() - x) * dt end the rotation is...
by PGUp
Tue Apr 25, 2017 2:23 pm
Forum: General
Topic: setting rectangle angle ? (not image)
Replies: 2
Views: 1469

setting rectangle angle ? (not image)

so to spawn a basic rectangle, i use draw function, but i have no idea how to set its angle, help ?
by PGUp
Mon Apr 24, 2017 1:57 pm
Forum: General
Topic: Getting value from table problem
Replies: 9
Views: 3932

Getting value from table problem

so, i want to get a value from a table, its hard to explain, this is the code : function love.load () a = 10 enemystuff = {} enemy = {} enemy.y = 100 table.insert(enemystuff, enemy) end function love.update(dt) if a > enemy.y then (print something here) end end so, i dont know how to get the enemy.y...
by PGUp
Mon Apr 24, 2017 11:03 am
Forum: General
Topic: mouse position problem
Replies: 4
Views: 2422

Re: mouse position problem

veethree wrote: Mon Apr 24, 2017 5:42 am Try this

Code: Select all

love.graphics.print(love.mouse.getX())
love.mouse.getX is a function, You need to end it with ().
oh ok, i tried it using a variable like
mousepos = love.mouse.getX()
and print the mousepos.. it works, but the number wont change when i move the mouse...
by PGUp
Mon Apr 24, 2017 2:40 am
Forum: General
Topic: mouse position problem
Replies: 4
Views: 2422

mouse position problem

hi, so i am a beginner here, and i have some problems with mouse position, so, let say i am trying to do this: love.draw() love.graphics.print(love.mouse.getX) end well, it wont work.. ive see the documentation and i think i dont really understand, can anyone explain about it ? i am trying to get th...