Search found 4 matches

by Jpfed
Mon Sep 09, 2013 3:12 am
Forum: Support and Development
Topic: TILED Map Collision Using Physics
Replies: 3
Views: 3918

Re: TILED Map Collision Using Physics

Let's say your tiles are either solid or not. Here's some pseudocode for creating fewer physics shapes, by consolidating horizontally-adjacent tiles into larger rectangles. More aggressive consolidation should be possible (e.g. rectangles that include tiles from more than one row), but I haven't fig...
by Jpfed
Thu Dec 03, 2009 4:10 pm
Forum: Support and Development
Topic: Drawing a circle with the correct number of segments
Replies: 4
Views: 4752

Re: Drawing a circle with the correct number of segments

The length of any one segment shouldn't be larger than some threshold (2 or 3 pixels?). So r*sin(2*pi/segments) <= threshold which means segments >= 2*pi/arcsin(threshold/r) This is approximated well by the following (and the approximation gets better as r increases): segments >= 2*r*pi/threshold Yo...
by Jpfed
Thu Dec 03, 2009 11:11 am
Forum: Support and Development
Topic: Exactly how reliable is World for a real game? (Big levels)
Replies: 11
Views: 10219

Re: Exactly how reliable is World for a real game? (Big levels)

kikito- in general, the union of two convex shapes is not necessarily convex. In fact, it's fairly rare that such a union would be convex. Unfortunately, if you try to make a polygonShape that is not convex, LOVE may crash (appears to happen consistently on OS X, but on Windows LOVE 0.5 lets it slid...
by Jpfed
Thu Dec 03, 2009 3:52 am
Forum: Support and Development
Topic: Exactly how reliable is World for a real game? (Big levels)
Replies: 11
Views: 10219

Re: Exactly how reliable is World for a real game? (Big levels)

The solution used for Adrift (a tile-based game that I'm working on with a friend, found here: http://github.com/jpfed/Adrift ) is as follows: 1. Create just one physics body with 0 mass (treated as immovable by box2d). Any tiles that will not move can be attached to that physics body. 2. Have a 100...