[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Best strategy to check all elements of a table
- From: Jose Marin <jose_marin2@...>
- Date: Mon, 29 May 2006 18:57:58 +0000 (GMT)
Hi!
I'm testing porting some C++ code to Lua.
One part of the code checks all elements on an array
against each other.
Is there some optimized way of do this in Lua?
I don't have to check collisions twice, only one time
for each pair of objects.
In pseudocode:
for obj1 = list.first to list.end do
for obj2 = list.first to list.end do
if obj1.collideWith(obj2) then
obj1.DoSomething(obj2)
end
end
end
Thanks for any tip!
__________________________________________________
Faça ligações para outros computadores com o novo Yahoo! Messenger
http://br.beta.messenger.yahoo.com/