Search found 721 matches

by Plu
Tue Sep 09, 2014 4:05 pm
Forum: General
Topic: [SOLVED]Help: making a square follow the mouse pointer
Replies: 3
Views: 2105

Re: Help: making a square follow the mouse pointer

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)
by Plu
Tue Sep 09, 2014 2:08 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 425434

Re: "Questions that don't deserve their own thread" thread

You can't, not really. You'll have to delay it manually: maxTime = 0.2 curTime = 0 function love.update( dt ) curTime = curTime + dt if curTime > maxTime then -- go to the next step of your animation curTime = curTime - maxTime -- for smoothness, don't just go back to 0 end end Incidentally, this is...
by Plu
Tue Sep 09, 2014 1:13 pm
Forum: General
Topic: [solved] love.graphics.newImage causes memory leak in MacOS?
Replies: 8
Views: 4371

Re: love.graphics.newImage causes memory leak in MacOS?

Shouldn't the texture be more or less fixed after it's first render? I can only imagine that right now it's either constantly jittering because it looks a little different on each run. I think you basic approach seems about right (except you should probably do it using a Shader because those are inf...
by Plu
Tue Sep 09, 2014 1:11 pm
Forum: Support and Development
Topic: How to tell if certain objects are colliding/hitboxes?
Replies: 5
Views: 2941

Re: How to tell if certain objects are colliding/hitboxes?

For images, you can use the offset variable:

Code: Select all

love.graphics.draw( image, x, y, 0, 1, 1, image:getWidth()/2, image:getHeight()/2 )
It's best to encapsulate that in your entities somewhere.

For physics-objects, I'm not sure if it's possible.
by Plu
Tue Sep 09, 2014 12:21 pm
Forum: Support and Development
Topic: How to tell if certain objects are colliding/hitboxes?
Replies: 5
Views: 2941

Re: How to tell if certain objects are colliding/hitboxes?

I can't really do a detailed debug right now, but you are aware that images are by default drawn with their X,Y in the top-left corner, while physics bodies by default are calculated with X,Y as the center of the hitbox? This is something that will cause the sort of things that you're seeing right n...
by Plu
Tue Sep 09, 2014 12:19 pm
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 425434

Re: "Questions that don't deserve their own thread" thread

If you want to quickly test-run changes and the like, you might want to check out a more advanced editor than Notepad++.

ZeroBrane Studio has the option to just tap the "run" icon at the top and immediately run your current code, and you don't even need to make a .love file for it :)
by Plu
Tue Sep 09, 2014 11:20 am
Forum: Support and Development
Topic: "Questions that don't deserve their own thread" thread
Replies: 905
Views: 425434

Re: "Questions that don't deserve their own thread" thread

Memory is only cleared when the garbagecollector runs, which might take some time if no other process needs the memory that is being held for no reason.

To force run it, do:

Code: Select all

collectgarbage()
and then check memory usage again :)
by Plu
Tue Sep 09, 2014 7:25 am
Forum: Support and Development
Topic: Collision Types - colliding with one object but not another.
Replies: 1
Views: 1163

Re: Collision Types - colliding with one object but not anot

What you'll probably want to do is use this: https://love2d.org/wiki/Body:setUserData This allows you to assign a lua value (use a table!) to the object, which you can then use in your collision function to determine which collisions should work. It's best to make the main collision function only ch...
by Plu
Tue Sep 09, 2014 6:28 am
Forum: General
Topic: [solved] love.graphics.newImage causes memory leak in MacOS?
Replies: 8
Views: 4371

Re: love.graphics.newImage causes memory leak in MacOS?

What are you trying to accomplish, anyway? There's probably a better way for it.
by Plu
Mon Sep 08, 2014 9:18 am
Forum: Support and Development
Topic: [Solved]Stairs
Replies: 7
Views: 3240

Re: Stairs

For completeness' sake, love.physics uses box2d, so they're basically the same. Also, it really helps if you upload a .love file of what you've made so far, because from the description in the opening post you could've been using a lot of different things and we have no real way of figuring out what...