Log In  

(Sorry if this post gets a little rant-y!)

My suggestion is for one simple command:

cspr(x1,y1,id1,x2,y2,id2)

mock-up of syntax

My reason:
When I had the idea to port my Gamebuino game, Smash and Crash, I thought this was going to be easy.
I was wrong.
The resolution nor the menus were not a problem, it was collision.
See, the Gamebuino's API had something nice about it: collideBitmapBitmap().
The command checks for two bitmaps, their x and y coordinates, and whether or not a pixel was overlapping.
With this, I was able to make collision very easily implemented.
In PICO-8 however, I find it to be very frustrating.
This is probably coming off as "I can't port my game, so you fix PICO-8 so I can.", isn't it?

Thanks for letting me waste your time(just don't look at it as "wasting").

P#14691 2015-09-27 22:50 ( Edited 2015-09-28 11:44)

It isn't very clear what is your source of "frustration" since implementing a function that checks if two rectangles overlap is like writing a function of a couple of lines of code.
If you're not able to write it, you can learn how such simple thing works looking into other carts. Since it's so common, basically every cart has its own "collide()".

EDITED: Sorry, I didn't read the "pixel perfect" part, thought you were talking about box collision. My bad.

P#14694 2015-09-28 01:41 ( Edited 2015-09-28 07:05)

Pixel-perfect collision is more complicated than box collision, yeah. That said, it's also a (relatively) heavy-duty function, and zep's been pretty clear about wanting to keep the native API streamlined, so its absence is not really a surprise.

I wrote up a demo cart for pixel collision when I was trying to work it out for a project a while back, and the implementation in there is pretty easily extractable into a standalone function you can use for a single-tile sprites, though it's not by any stretch the cleanest or leanest implementation. But it's an example of one approach, and I'd imagine other folks have come up with versions that are tighter and/or more extensible that they'd be willing to share.

P#14697 2015-09-28 02:28 ( Edited 2015-09-28 06:28)

@pistacchio It's fine. It's just that I can't make any sense of the collision, so I have to base my game on JELPI, and I'm not a big fan of taking somebody else's code and changing it dramatically, because the game would still feel like a mod.

@joshmillard I'm not entirely sure how box collision is done on PICO-8 (I know how to use it, though), but I'm pretty sure pixel collision is much more demanding. I'll have to check out that cart sometime.

Side Note: I found that in JELPI, anything with an orange flag collides with something. Neat-o to have a toggle!

P#14703 2015-09-28 07:44 ( Edited 2015-09-28 11:44)

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 04:34:57 | 0.012s | Q:16