Search found 3096 matches

by kikito
Tue Nov 10, 2009 11:51 am
Forum: Support and Development
Topic: sprite look to cursor
Replies: 9
Views: 3139

Re: sprite look to cursor

You could use the update function to update mousex before each frame is drawn: function update(dt) mousex = love.mouse.getX( ) end Another (possibly less correct) way is to set mousex inside your draw function: function draw() mousex = love.mouse.getX( ) love.graphics.setBackgroundColor( 50, 50, 50 ...
by kikito
Tue Nov 10, 2009 10:43 am
Forum: Support and Development
Topic: lua objects?
Replies: 7
Views: 1381

Re: lua objects?

Hi Carl, Lua is so flexible that by using metatables and metamethods it is possible to replicate C#/Java classes and instances functionality (also inheritance, mixins...) I've done so in my PÄSSION lib ( http://love2d.org/forum/viewtopic.php?f=5&t=1039 ). Concretely, the part that implements Object ...
by kikito
Tue Nov 10, 2009 10:28 am
Forum: Support and Development
Topic: Simple Collision
Replies: 3
Views: 987

Re: Simple Collision

I've done a quick google search and found this: http://silentmatt.com/computers/playground/intersection.php According to this page, it is easier if your rectangles are specified as four points (without heights and widths): If we call them A.x1, A.y1, A.x2, A.y2, B.x1, B.y1, B.x2, B.y2, we end up wit...
by kikito
Tue Nov 10, 2009 9:40 am
Forum: Support and Development
Topic: Question regarding table.insert()
Replies: 9
Views: 1693

Re: Question regarding table.insert()

Candall, your code is a bit difficult to understand, but if I understood it correctly, I think there are more efficient ways of doing it. It seems that you want to: Create one character Parse lua code for him, from another file (extension *.act) The problem with this approach is that it is reading t...
by kikito
Tue Nov 10, 2009 8:39 am
Forum: Libraries and Tools
Topic: PÄSSION: object-oriented LÖVE
Replies: 90
Views: 21488

Re: PÄSSION: object-oriented LÖVE

Hi Technocat,

I deactivated the rotation in order to debug the centering more easily. I've activated it again. Thanks for the testing!

I don't know why the bodies stop colliding - I may do more tests when 0.6 is more advanced.
by kikito
Mon Nov 09, 2009 11:20 pm
Forum: Libraries and Tools
Topic: PÄSSION: object-oriented LÖVE
Replies: 90
Views: 21488

Re: PÄSSION: object-oriented LÖVE

Ok I got it working with 0.6! A couple notes: Since images are not "centered" any more on 0.6, I had to add some setCenter and getCenter helper methods. I'm still not satisfied with the results (the borders are not exactly "pixel-perfect" with the images), but I believe I'll leave them as they are n...
by kikito
Mon Nov 09, 2009 11:06 pm
Forum: General
Topic: 0.6.0 Update
Replies: 221
Views: 37038

Re: 0.6.0 Update

Ok now I think I got one missing thing on 0.6.0

I tried calling body:setVelocity(0,0) on a pysics body and I got a "tried to call a non-existing (nil) function" error.

Regards!
by kikito
Mon Nov 09, 2009 12:01 am
Forum: General
Topic: 0.6.0 Update
Replies: 221
Views: 37038

Re: 0.6.0 Update

Hi again

newRectangleShape does seem to have the same syntax as before. My problem was somewhere else in my code - apologies.
by kikito
Sun Nov 08, 2009 9:34 pm
Forum: General
Topic: 0.6.0 Update
Replies: 221
Views: 37038

Re: 0.6.0 Update

Exactly - I meant the physics stuff.

The potato docs don't mention any "new*" stuff (newRectangleShape, newCircleShape...) and I could not find references to any of this by browsing the source code - maybe this isn't ported yet, I can't say for sure.
by kikito
Sun Nov 08, 2009 6:10 pm
Forum: General
Topic: 0.6.0 Update
Replies: 221
Views: 37038

Re: 0.6.0 Update

Hi everyone, I'm not sure if this is the right place to start asking about specifics of 0.6 - please move it to other place if not. How do we do rectangular shapes in 0.6? In order words, what would be the equivalent of this: shape = love.physics.newRectangleShape(x, y, w, h) After a (pitiful) try t...