Submit Your Own Code

PSP Lua CodeBase : Simple Collision Box

Description:
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

Please welcome stepbrother1988, our newest member.

Who's Online:

Total Members: 844
Total Posts: 13009
Total Topics: 1473
Total Categories: 7
Total Boards: 25

Recent Posts:

Re: chek it out i made front page of qj.net by chi-kitory
Re: chek it out i made front page of qj.net by Rick
Re: Hi everyone (remember me? :P) by Tdude_gamer
Re: Hi everyone (remember me? :P) by dan369
Hi everyone (remember me? :P) by Tdude_gamer
Re: Hows everyone doing? by osgeld
Re: Homebrew Idol 3: The Homebrew Horror Show by dan369
Problem on Tag game by andykd7


Copyright © 2006-2009 www.EvilMana.com All rights reserved.
EvilMana Logo by emcp and Charlie