gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > My new Release

#9859 - iuiz - Wed Aug 20, 2003 12:34 pm

Hiho,

i have just added Collission Detection to my Programm. It is not open Source at this Moment, because I have to clean up the Code. I have no Idea how it works on Hardware, so perhaps someone is able to fix the header (and perhaps tell me how :p) and try it on Hardware.

www.halof.com/gba/rpgBeta3.zip

The next thing I am going to fix is the time, that is needed to start (several seconds), and add a Text System.

Comments?

Cu,
iuiz

PS: Damit, why havent I started Developing for the GBA two years ago... It is realy fun![/url]

#9874 - yaustar - Wed Aug 20, 2003 8:18 pm

The collision detection is a little the moment, as the character stops even when there is nothing to collide with... I think this could be due to the boundary boxes around the sprite.

I haven't had a chance to try it on hardware, but you can get the header tools from gbadev.

I also notice that it takes it's time to load up, I believe this is because you are calculating the sin and cos values in real time.

If you are using gbajunkies files for the bg, then you may want to use precalculated tables instead. Go to my webpage and try them if you want to...

http://www31.brinkster.com/yaustar/dev/gba.html
_________________
[Blog] [Portfolio]

#9886 - iuiz - Thu Aug 21, 2003 6:03 am

Hey, thx! I wust just to lazy, to change the sin and cos stuff by myselfe :).
The Collision ist a little bit buggie, because i am a using 16x32 for the Sprite size, but the charakter has only 16x24 pixels. There is a black line drawn, which represents the end of the Sprite.
The only real bug, is, when you walk up and collide with the small wall (there is only one small wall :)). Sometimes you wont be able to go left or right.

The Problem is, that it is a realy unflexible Engine at this time (for example the 16x32//16x24 problem). But i think, that I will fix it within the next few days.


Thx 4 your comment and the sin and cos file :). It will save me some work :p.


Cu,
iuiz

#9928 - yaustar - Fri Aug 22, 2003 1:17 am

Thanks for the praise :)

If you can make the collision boundary box to the size of the sprite, so the engine is checking the collision between the size of the box rather then the sprite.

This should fix most of the bugs, if you could share the source then that be great...
_________________
[Blog] [Portfolio]

#9944 - iuiz - Fri Aug 22, 2003 2:21 pm

It will go open source, if I have fixed the source, because if I would release it now, there is too much "dead-code" in it.

I havnt made the collision detection with bounding boxes.

I read the coordinates from all the walls by myself (with MS-Paint.. it took nearly 10 Minutes *g*). So I have just 4 lines of code for the colision Detection (I think it should save some speed). I will write a map editor, so that I can create these lines of code autmoaticaly, but that is not my primary target atm (perhaps in only delphi, who knows (dont flame me, i hate delphi (normaly))).