How avoid colisions?

0 favourites
  • 5 posts
  • Hello, I want to know how to avoid colisions in my row?

    I did a row with one sprite, and this sprite has a "creat object" comand...every 3 seconds, are generated other sprite, and this sprite has colision with himself....

    But, my sprite are acomulating in the begin of this scene...

    how I do?


  • Hi Pablo,

    If I'm correct you are still working on your grocery-store project.

    Instead of asking many questions on how different events work, maybe it's easier to first think of what you would like to achieve and break that down into little pieces so you can figure out how to program them.

    The first thing you said was that if the price is right and the weather is good and etcetera.

    This would mean making variables which you can compare to see if these conditions are met.

    If these conditions are met you want to have a line form at the counter.

    That would mean that if the conditions are met you'd either want sprites to move to the counter or have sprites created at the counter.

    To make a line you could make invisible sprites and set directions to them. If first sprite in line is overlapped set the next sprite to got to the second sprite in line. If first sprite in line isn't occupied, but second sprite is, set the sprite overlapping the second sprite to go to the first sprite in line.

    but how to get the first sprite in line to leave?

    You could do this by setting the sprite to wait for an specified amount of time and then set direction and movement away from the counter.

    If you don't understand this explenation, be sure to read the manual again and follow some tutorials to get the hang of programming within C2.

    Programming is always slicing things up into small pieces. And making events that trigger when certain conditions are met.

    [stupid example]

    If you would tell a computer to go to the table and sit down. It would just sit down. If you would tell it to go to the table and after arriving there to sit down. It would sit down on the floor next to the table after walking there. If you would tell a computer to go to the table and after arriving grab a chair and sit down. It would be sitting on the floor next to the table holding a chair. So You should tell the computer to go to the table and after arriving grab a chair, pull it out so it is possible to sit on it and if it is pulled out sit down on it. Then maybe at the end you would have your computer sitting at the table on a chair, if you haven't confused him too much with other things to do. Be sure there is a table to go to and to tell the computer which table and that at the table is a chair and that you've explained to the computer what sitting is and you've told him in how he should get to the table, etcetera..[/stupid example]

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Well, is my grocery-store...i have problem with the row, the people walk, stop and leave the store...but, when the number of people is row stop and make a colision every time....

    I try to do a overlapping, in this overlapping if the people overlapping other people, both leave the scene...but in given moment, my row stop and walk low, and after the overlapping all peoples leave the scene and the row restart...

    I want to know, how I will do to my row walk, buy and stop, without lags!

    Obs: How I send a .capx??? I have a dropbox but I don't know how!!

  • To send capx put it in the dropbox public folder and right click on it to copy public link. than you can paste the link in your reply.

    Sounds to me you want a maximum length for the row, so sprites only get in line when there is a space for them.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)