tile collision..how?

Forum for J2ME mobile games related topics including programming doubts, books and other resources for J2ME game development

tile collision..how?

Postby itskrishnaraj » Thu Sep 18, 2008 6:24 am

hi guys

i jus want know about the tile collision, in our game we are creating our environment or game filed with tiles and i jus throw a ball in air wen ot hits any of the tile the corresponding tile should remove...how to detect the collision ?..ball is not jus a sprite its a strips of image ..i am drawing the image using drawRegion(ball) so i guess i can't use sprite option


jus give me

thanks in advance
itskrishnaraj
 
Posts: 39
Joined: Thu Aug 07, 2008 1:28 pm

Re: tile collision..how?

Postby DevelopmentTeam » Fri Sep 19, 2008 11:33 am

detecting collision is simple and efficient only if you write your own classes, plz don't use the one that is available in the J2ME package as the implementation is highly CPU hungry.

You have check if each of the corners whether it is falling within the other object(i.e. within the 4 corners of second object). doing this will be enough.
User avatar
DevelopmentTeam
Site Admin
 
Posts: 661
Joined: Tue Aug 15, 2006 8:39 am
Location: India


Return to J2ME Games

Who is online

Users browsing this forum: Bing [Bot] and 2 guests