a different kind of collision problem

i have 2 physics objects

1. object inserted into group gp
2. object inserted into group bg

the two objects collide
what i am trying to do is duplicate the issue most are having with the two objects not colliding when in different groups

or maybe its cause one object is animated is why they collide idk

never mind wasnt thinking one object pushing other and collision event two different things must have been a blonde moment

.... You're lucky I haven't been in the sun much the past few years and my hair is now light brown, otherwise those would be fighting words.

jstrahan,

I tested your code really quick today and I still have to play with it to see if it will integrate into my existing code. My issue with physics objects not colliding correctly in separate groups is related with me moving my display group using transition.to().

Check out shane.lipscomb post in this older thread dicussion about collisions:
http://developer.anscamobile.com/forum/2011/09/12/my-code-doesnt-work-it-should

According to shane.lipscomb, if you modify the x or y coordinate values of your display group, it messes up the physics collision detection and I guess the collision occurs at the original x and y location and not the new location. I've seen this happen in my game through debugging and print statements. This really sucks because I need to move my display group towards the player.

For example, I'm making a parallax scrolling game where I have a bunch of coins stored in a group and the coins need to move towards the player. The player in my game cannot move forward or backward, but only up and down, similar to that game called JetPack Joyride. Because my player cannot move forward, I have to move the coins toward the player using transition.to().

By placing the coins in a group, the collision detection gets all messed up and it doesn't work correctly. However, if the same coins are placed outside of a group and I move each coin individually, the physics collision detection works PERFECT. But now I've introduced a different issue to my game, by moving each coin individually across the screen, it causes a performance or stuttering issue with the fps. My coins have to go across the screen and once they get off the screen, then they have to reset their location back to the original location and later move across the screen again. The level is endless and the coins need to recursively keep coming towards the player at different time intervals.

Hopefully, this makes sense. Sorry for the long message.

Oh yeah! I got alot of coins moving. At least minimum 20 or more.

think I can solve this when I get home in 30

views:1501 update:2011/11/5 17:18:39
corona forums © 2003-2011