|
Submit
Your Own Code
PSP Lua CodeBase : Simple Collision
BoxDescription:
this code assumes that your pictures are set up like this:
pic1={}
pic1[img] = Image.load( "./imgs/pic1.png" )
pic1[x] = 52
pic1[y] = 126
arguments are the picture tables: checkcollision(pic1 , pic2)
PLEASE NOTE: UNTESTED but should work.
-- EVILMANA.COM PSP LUA CODEBASE
-- www.evilmana.com/tutorials/codebase
-- Simple Box Collision
-- SUBMITTED BY: nathan42100
function checkCollision(col1 , col2)
if col1[x]>=col2[x] and col1[x]<=(col2[x] + col2[img]:width()) then
if col1[y]>=col2[y] and col2[y]<=(col2[y] + col2[img]:height()) then
return true
end
else
return false
end
end
Back to CodeBase
|