![]() ![]() Now observe the rows for each object type. For complex games, you can continue past 512 - up to 32768 (16 columns) if necessary - but 10 columns is enough for most games. These "bit" values are the essential aspect in determining collision filter values. Observe the numbers in the uppermost row: 1 to 512 in binary progression. local crate1 = display.newImage( "crate.png" ) For example, you may wish to store object names in an easily-accessible string format. ![]() ![]() Because Corona display objects behave like Lua tables, you may freely add arbitrary data to these tables such as names, category designators, point values, or even stored functions, and then retrieve this data at collision time. For local collision handling, each collision event includes a self table ID, representing the object itself, and event.other which contains the table ID of the other Corona display object involved in the collision. Local collision handling is best utilized in a one-to-many collision scenario, for example one player object which may collide with multiple enemies, power-ups, etc.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |