Collide and Overlap Problems

thiagoralvesthiagoralves Member Posts: 8
edited November -1 in Working with GS (Mac)
Hi again,

As I said on another topic, I'm trying to make a Puzzle Bobble clone with GS. Using the CodeMonkey "Jewel Destruction" Template, I was able to understand the 3-match logic needed for this game and the random colors bubbles. Now I'm having problem with phisics. Well, the game starts with some bubbles fixed at the screen and a cannon that can shoot bubbles on the fixed bubbles. But when I shoot a bubble, if it collides with another bubble, it must stay there fixed with the other bubble. My first attempt was to put a Rule that when it collide or overlap the object Bubble it must change it's physics state "Movable" to false. Didn't work. The bubble overlaps the other bubble without stopping. Next I tryed to put Change Velocity to zero on that same rule. Didn't work also. The only thing that "kinda" worked was change linear x and linear y velocity to zero. But it's still buggy. Sometimes the bubble stops really close to the other bubble, sometimes it overlaps the other bubble a little bit. So, it never stops at the same position. Actually it should stop without overlapping. Is there a better way to do that? Thanks.

Comments

  • firemaplegamesfiremaplegames Member Posts: 3,211
    You cannot change Movable at runtime. The safest way is to have two versions of the actor. One is Movable, the other isnt. When it collides, spawn the nonmovable one and destroy the original.
  • thiagoralvesthiagoralves Member Posts: 8
    I did what you said. I destroyed the actor and created another one in the same position of the destroyed, but it is still overlapping a little bit. It seems that the function "collide or overlap" is a little slow and can't check in real time if the object is actually colliding. So the object overlaps a little area of the other one and then execute the function.
  • thiagoralvesthiagoralves Member Posts: 8
    Well friends, my best approach was to create two collide functions: one to bounce when collide with the bubble and the other is a rule that when it collide or overlaps the actor bubble it self destroy and spawn another fixed actor on it's place. Doing this way, the object bubble never overlaps the other because of the "bounce when collide" function and also spawn a fixed actor on it's place. Was the best approach to the original Puzzle Bobble game, but it's not perfect as you can see on the screenshots. My game doesn't organize the bubbles. They are never at the same line.

    My Clone: [IMG]http://i976.photobucket.com/albums/ae243/ntware/Imagem3.png[/IMG]
    Original Game: [IMG]http://i976.photobucket.com/albums/ae243/ntware/Imagem1.png[/IMG]

    So, after analizing the image of the original game, I realized that the bubbles are aligned into a pre-determined position into a line, so that it stays allways aligned. I'm thinking about how can I make the same thing on my game. Maybe I can create many invisible bubble actors and populate all the screen with them. So, when a true bubble actor is created, it must self-align according to the closest invisible aligned bubble. Do you think that it can work?
  • thiagoralvesthiagoralves Member Posts: 8
    sorry, how can I post images on this forum? Anyway, you can see the screenshots by copy and paste the image link to your address bar
  • BarkBarkCoBarkBarkCo Member Posts: 1,400
    `image`
  • thiagoralvesthiagoralves Member Posts: 8
    ok, so here are the pictures

    My Game:
    image

    Original Puzzle Bubble:
    image

    Any ideas about how can I align the bubbles?
Sign In or Register to comment.