Search found 38 matches

by ghostwriter
Sat Jan 08, 2011 6:47 pm
Forum: General
Topic: 2.5D implementation
Replies: 13
Views: 5890

Re: 2.5D implementation

Yes, there might be a more compact way to do it, if so, let me know. As long as it takes the same parameters and returns the same values, I don't care what the function looks like. At the risk of hijacking paramecij's thread, i'll share my rectangle collision code: function overlap(x1,y1,w1,h1,x2,y...
by ghostwriter
Sat Jan 08, 2011 6:33 pm
Forum: Support and Development
Topic: Weightless Physics object
Replies: 18
Views: 6222

Re: Weightless Physics object

Okay I found the problem. The issue is that world:setGravity(x,y) sets the gravity in pixels , while body:applyForce works in SI units (newtons, meters, etc). What you need to do is divide your force by world:getMeter to scale it from pixels to meters. body:applyForce(-gravX*bodyMass/world:getMeter(...
by ghostwriter
Sat Jan 08, 2011 7:17 am
Forum: Support and Development
Topic: Weightless Physics object
Replies: 18
Views: 6222

Re: Weightless Physics object

Assuming there's no "right way" to do this, couldn't you get the same effect by applying a force opposite to gravity?

Code: Select all

gravX, gravY= world:getGravity()
body:applyForce(-gravX*body:getMass(), -gravY*body:getMass()
by ghostwriter
Mon Jan 03, 2011 8:45 pm
Forum: Support and Development
Topic: Love's Folder Read-Only On Win7?
Replies: 3
Views: 1599

Re: Love's Folder Read-Only On Win7?

I had this problem too, because win7 protects everything in Program Files and Program Files(x86). I solved it by keeping another copy of love2d elsewhere on the hard drive which I use for bundling.
by ghostwriter
Mon Jan 03, 2011 5:00 pm
Forum: Support and Development
Topic: Optimizing parallax star background
Replies: 11
Views: 6869

Re: Optimizing parallax star background

kikito wrote:Just make them screen-sized and draw them 1,2 or 4 times when needed.
I think the pattern repetition would be quite noticeable... though if each tile layer is moving at a different speed that might work.
by ghostwriter
Mon Jan 03, 2011 4:53 pm
Forum: Support and Development
Topic: My old nemesis, math
Replies: 12
Views: 3144

Re: My old nemesis, math

Here's one that uses "normal" math functions. It hits a peak of 0.1 or -0.1 at x=1/3: y=0.1*(x-1/3)/abs(x-1/3)*(exp(-abs((x-1/3)*32))) func.png You can "stretch" it by changing the 32 at the end. A lower value makes for a wider falloff, a larger number will make sharper falloff.
by ghostwriter
Mon Jan 03, 2011 4:37 pm
Forum: Support and Development
Topic: Optimizing parallax star background
Replies: 11
Views: 6869

Re: Optimizing parallax star background

So you want to have stars that appear in random positions, that have random sizes, different colours, and random velocities? Why not just use a single Particle System?
by ghostwriter
Mon Dec 27, 2010 6:29 am
Forum: Support and Development
Topic: Scaling/translating/rotating mouse coordinates
Replies: 8
Views: 4369

Re: Scaling/translating/rotating mouse coordinates

If you apply the same transformations to the mouse coordinates as you do to the world, you should get the correct coordinates. It's important that you know the order of transformations and duplicate them exactly. Are you scaling/translating/rotating the world with your own code, or are you using a c...
by ghostwriter
Sun Dec 26, 2010 5:32 pm
Forum: General
Topic: What you got for X-MAS.
Replies: 31
Views: 9596

Re: What you got for X-MAS.

TechnoCat wrote:Do you have a PIC for that?
I have six MSP430's and an arduino, not entirely sure what I'll do with them yet though!
by ghostwriter
Sun Dec 26, 2010 5:39 am
Forum: General
Topic: What you got for X-MAS.
Replies: 31
Views: 9596

Re: What you got for X-MAS.

I got a copy of Mass: The Art of John Harris, a bunch of shirts, and a little LCD character display!