Jump to content

  • Log In with Google      Sign In   
  • Create Account

Banner advertising on our site currently available from just $5!


1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!






Simple 2D game... Simple collision? Probably not? =-=

Posted by dejaime, 19 December 2011 · 893 views

Helmet beginner development 2D collision
Thinking on my next step on my game that's start coding the whole stuff, so I can realize I'm not gonna make it and give up already, and I have to choose an engine...
HGE's great for it's simplicity, how they say, make games, not engines! But Allegro seems more powerful and is a lot more realiable, not to mention it's cross-platform, as if anyone cares for cross-platforming. But yesterday I discovered pmask, a really good collision utility for allegro and SDL! It's detection is perfect and it's unbelievably fast for that kind of precision...

For those interested: PMASK
There're two exe demo showing it's incredibly good performance and detection precision! Give them a try!
Did I say it is "pixel perfect"? D:

@Edit: It turns out that PMASK is only Allegro4... what a disappointment! Anyway, the author's released his work (thanks for it if you're reading this haha) on public domain, anyone can port it!
I guess I'll have to read his code and see how he's done the computing. Maybe I can make a ported version for allegro 5 or maybe I'm laughably wrong thinking it's incompatible...

@Edit2: nightcracker has posted the following files on the comments:
https://raw.github.com/gist/1460947/e94f96497ee759e64828a3e0b3ea7defb170a7b8/bitmask.c
https://raw.github.com/gist/1460953/199aed3e3d6acf9353e25c1eb582c53eaa8777ea/bitmask.h
Thanks again!




I would strongly recommend Allegro!!! I've been using this for along time, and it's come along way in Allegro 5! Engines are never bad to use, mind you it saves time! But people don't realize after you've completed a few games just by using an API, you've already made a lot of reusable code! One trick is to program your games as normal, but with a generic way of handling how the code works, simply so you can re-use it with ease.

I suggest you just pick one thing, and stick with it until you've made at least one complete game with it. You will either love, or hate the experience.

I look forward to your progress! :)
Thanks for the cheer! I am going to use allegro 5. HGE's simplicity is nice, but I can't deal with lack of proper documentation, as well as being windows only... Still, if I can't make pmask work for me, I'll have to code the perfect collision myself! Well, better put my brain in the oven and fingers to work!

Thanks for the comment!
Hi dejaime,

I'm not familiar with Allegro, but, I tout SFML a lot. Have you looked atSFML as well? If so, why did you choose Allegro instead of SFML? I'm curious if I should look into Allegro now.

Thanks.
I actually considered SDL, Allegro, OpenGL and DirectX! (HGE was just mentioned since this journal aims to begginners and high level libraries are good for who want to dive in and learn!)

I like allegro due to lots of reasons, I'll list some here:
0 - Nice and really helpful community
1 - Portability/Flexibility.
Allegro runs pretty well on Win/Mac/Nix and iPhone... There's even an Andoird port mantained by the community!
2 - Extremely easy to learn/use. <-- this is really important!
3 - Inpeccable documentation!

4 - the technical side:
4.1 - Modular
4.2 - Threading
4.3 - Hardware Accelerated
4.4 - Good Timers implementation
4.5 - Great Events System for Keyboard input, timers and display (such as resize or minimized the window, etc)
and probably 100 more I can't remember right now! haha

I really like allegro, it's good to use and easy to set up!
Not to mention it's also free.

I only got to know SMFL after I was actually using allegro for about 4 months, I didn't really give it a chance (yet)...

I think it's also good to say that the next allegro version (5.1, the unstable is already downloadable) will have shaders!
You might want to publish this:

https://raw.github.c...0a7b8/bitmask.c
https://raw.github.c...777ea/bitmask.h

I ripped it out of pygame, it has very good performance. LGPL.
I'll add that to the post! Thanks for it!

I am actually half-way on my own collision engine that'll put together spacial hashing, bounding boxes and precise pixel perfect collision, all coded under allegro's bitmaps. It's working nicely as of now, but the grid is hardcoded, I am still to create a way of cofiguring the grid...
By some weird reason, my anti-virus detected the HGE compressed file as a trojan while didn't detect anything in the uncompressed folder.
AVs and their problems with compressed files...

0 user(s) viewing

0 members, 0 guests, 0 anonymous users

Latest Visitors

April 2015 »

S M T W T F S
   1234
567891011
12131415161718
19202122232425
26 27282930  

Google Shared Items

PARTNERS