mirror of
https://github.com/vrld/HC.git
synced 2024-11-28 14:04:21 +00:00
Merge pull request #56 from mchlnix/patch-1
adds missing do statement after for loops
This commit is contained in:
commit
4e87f0df1b
@ -214,7 +214,7 @@ You can iterate over the shapes using ``pairs`` (see example).
|
|||||||
**Example**::
|
**Example**::
|
||||||
|
|
||||||
local collisions = HC.collisions(shape)
|
local collisions = HC.collisions(shape)
|
||||||
for other, separating_vector in pairs(collisions)
|
for other, separating_vector in pairs(collisions) do
|
||||||
shape:move(-separating_vector.x/2, -separating_vector.y/2)
|
shape:move(-separating_vector.x/2, -separating_vector.y/2)
|
||||||
other:move( separating_vector.x/2, separating_vector.y/2)
|
other:move( separating_vector.x/2, separating_vector.y/2)
|
||||||
end
|
end
|
||||||
@ -237,7 +237,7 @@ You can iterate over the shapes using ``pairs`` (see example).
|
|||||||
**Example**::
|
**Example**::
|
||||||
|
|
||||||
local candidates = HC.neighbors(shape)
|
local candidates = HC.neighbors(shape)
|
||||||
for other in pairs(candidates)
|
for other in pairs(candidates) do
|
||||||
local collides, dx, dy = shape:collidesWith(other)
|
local collides, dx, dy = shape:collidesWith(other)
|
||||||
if collides then
|
if collides then
|
||||||
other:move(dx, dy)
|
other:move(dx, dy)
|
||||||
|
Loading…
Reference in New Issue
Block a user