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 anthonyjee, our newest member.

Who's Online:

Total Members: 522
Total Posts: 13085
Total Topics: 1515
Total Categories: 7
Total Boards: 42

Recent Posts:

Re: Hello every body... by DeniseVera
Need help please by Robbynator
Re: Hello every body... by horvathann
Re: background criminal record check by backgroundchecker
background criminal record check by backgroundchecker
Intro to Perl Part 2: What are Scalars? & Examples by Chi Kitory
Intro to Perl Part 1 About Perl and Hello World by Chi Kitory
Re: Trying To Get Rid of the Spammers by Charlie


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