Per-Pixel Collision...

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Yojimbo
Prole
Posts: 6
Joined: Wed Jul 21, 2010 2:25 pm
Location: Dallas, TX
Contact:

Re: Per-Pixel Collision...

Post by Yojimbo »

Thanks for the advice concerning the texture sizes. I'll look into modifying the sample.
User avatar
Tesselode
Party member
Posts: 555
Joined: Fri Jul 23, 2010 7:55 pm

Re: Per-Pixel Collision...

Post by Tesselode »

So, is anyone allowed to use this for their projects?
User avatar
TechnoCat
Inner party member
Posts: 1611
Joined: Thu Jul 30, 2009 12:31 am
Location: Milwaukee, WI
Contact:

Re: Per-Pixel Collision...

Post by TechnoCat »

This is really cool, but I would really like to see it working with some sort of side-scrolling physics.
User avatar
Yojimbo
Prole
Posts: 6
Joined: Wed Jul 21, 2010 2:25 pm
Location: Dallas, TX
Contact:

Re: Per-Pixel Collision...

Post by Yojimbo »

Tesselode wrote:So, is anyone allowed to use this for their projects?
Feel free to use it for whatever you want except making stupid games like FarmVille, which I hate with all of my being. Of course, if you use it to make a game that makes buzillions of dollars... maybe you can buy me a beer.
User avatar
thelinx
The Strongest
Posts: 857
Joined: Fri Sep 26, 2008 3:56 pm
Location: Sweden

Re: Per-Pixel Collision...

Post by thelinx »

bartbes wrote:Only the name garbles on forum uploads, and I keep telling thelinx to fix it (see?).
:cry:
User avatar
Yojimbo
Prole
Posts: 6
Joined: Wed Jul 21, 2010 2:25 pm
Location: Dallas, TX
Contact:

Re: Per-Pixel Collision...

Post by Yojimbo »

TechnoCat wrote:This is really cool, but I would really like to see it working with some sort of side-scrolling physics.
I actually developed this sample because the course I'm teaching will have the students modify a side-scrolling space shooter styled game and I needed a way to check for collisions between the ship's image and the terrain's image which will be too irregular to use the simpler bounding box technique.

Unfortunately, I'm not ready to release any of that code because I'm still working out the level loading mechanism which will load and scroll the terrain images.
User avatar
Combokarel
Prole
Posts: 23
Joined: Sun Apr 27, 2014 11:18 am

Re: Per-Pixel Collision...

Post by Combokarel »

I've found a little issue with your code, if you don't use rounded numbers like: 1, 2, 3 .. then
y2 can be zero because it get's floored and thus line 144 will give an error saying there's a nil value, I think that if you change math.floor to math.floor(n+0.5) (round the number) then the error will get solved (or maybe math.ceil, I don't know :))

P.S. sorry for the bad English :(
User avatar
Combokarel
Prole
Posts: 23
Joined: Sun Apr 27, 2014 11:18 am

Re: Per-Pixel Collision...

Post by Combokarel »

And then i see the last post was from 2010 -_-
User avatar
dusoft
Party member
Posts: 655
Joined: Fri Nov 08, 2013 12:07 am
Location: Europe usually
Contact:

Re: Per-Pixel Collision...

Post by dusoft »

http://www.codesampler.com/source/love_ ... ision.love

Your .love file does not work fro the latest Love2D 0.9.1. Please, remove constraints regarding the version, otherwise most of the uses won't be able to use it.
User avatar
Ranguna259
Party member
Posts: 911
Joined: Tue Jun 18, 2013 10:58 pm
Location: I'm right next to you

Re: Per-Pixel Collision...

Post by Ranguna259 »

You do know that this thread is 4 years old. OP is long gone..
LoveDebug- A library that will help you debug your game with an on-screen fully interactive lua console, you can even do code hotswapping :D

Check out my twitter.
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests