Search found 25 matches

by nate890
Fri Jan 27, 2012 5:43 am
Forum: Support and Development
Topic: Pauses (Waits, sleeps, etc.), is it Possible?
Replies: 17
Views: 7149

Re: Pauses (Waits, sleeps, etc.), is it Possible?

Why would you write such a function?
It was an example
by nate890
Fri Jan 27, 2012 5:26 am
Forum: Support and Development
Topic: Pauses (Waits, sleeps, etc.), is it Possible?
Replies: 17
Views: 7149

Re: Pauses (Waits, sleeps, etc.), is it Possible?

local x=5

local keys={
["w"]=function()
while true do
x=x+1
love.timer.sleep(10)
end
end;
}

keys["w"]()
No error there, still crashes.
by nate890
Fri Jan 27, 2012 5:25 am
Forum: Support and Development
Topic: Simple GUI Collision
Replies: 12
Views: 3213

Re: Simple GUI Collision

Blaarrggh, I was trying to prevent the variable option. Guess it's the only option.
Love2d should add a method that returns the size.x, size.y and pos.x, pos.y
by nate890
Thu Jan 26, 2012 8:55 pm
Forum: Support and Development
Topic: Simple GUI Collision
Replies: 12
Views: 3213

Re: Simple GUI Collision

I don't have any code, I was wondering if anyone had any snippets to calculate 2 objects (such as a rectangle) colliding? You are looking for HardonCollider . Btw, you obviously need to create and remember the objects with their sizes and positions, so later you can check it. But what if I don't kn...
by nate890
Thu Jan 26, 2012 5:16 am
Forum: Support and Development
Topic: Simple GUI Collision
Replies: 12
Views: 3213

Re: Simple GUI Collision

Yes, that's exactly what I'm looking for, but "ax1,ay1,aw,ah, bx1,by1,bw,bh", how do I get the size and position of an object? Eg; local rectangle=love.graphics.rectangle("fill",400,300,20,20) and some method(s) like; local x,y=rectangle:getPosition() local x,y=rectange:getSize()
by nate890
Thu Jan 26, 2012 2:25 am
Forum: Support and Development
Topic: Simple GUI Collision
Replies: 12
Views: 3213

Re: Simple GUI Collision

I don't have any code, I was wondering if anyone had any snippets to calculate 2 objects (such as a rectangle) colliding?
by nate890
Wed Jan 25, 2012 11:11 pm
Forum: Support and Development
Topic: Pauses (Waits, sleeps, etc.), is it Possible?
Replies: 17
Views: 7149

Re: Pauses (Waits, sleeps, etc.), is it Possible?

bartbes wrote:You might want to know that if threads error, they 'send' a variable 'error' containing the error message.
That's good to know :).
The function is called love.timer.sleep.
Oops, meant to put that in, my bad.
by nate890
Wed Jan 25, 2012 10:58 pm
Forum: Support and Development
Topic: Hiya All!
Replies: 2
Views: 1234

Re: Hiya All!

Awesome, Thanks!
by nate890
Wed Jan 25, 2012 10:54 pm
Forum: Support and Development
Topic: Pauses (Waits, sleeps, etc.), is it Possible?
Replies: 17
Views: 7149

Re: Pauses (Waits, sleeps, etc.), is it Possible?

The code isn't much, that's why I didn't post it, but sure;

Code: Select all

local keys={
	["w"]=function()
		while true do
			x=x+1
			love.thread.sleep(10) --Crashes, still
		end
	end;
}
by nate890
Wed Jan 25, 2012 10:24 pm
Forum: Support and Development
Topic: Simple GUI Collision
Replies: 12
Views: 3213

Simple GUI Collision

Any simple, simple GUI collision formulas for Love2D, using basic rectangles/squares.
I would write one myself, but I don't know how to get a GUIs size (x,y) and a GUIs position (x,y) yet (As I am new to Love2D).
^However, if you can tell me how to get these 2 things, I can write on myself.

Thanks!