How avoid colisions?

Get help using Construct 2

Post » Tue Jul 02, 2013 7:45 pm

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?

thanks
B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Tue Jul 02, 2013 8:48 pm

http://www.scirra.com/forum/random-create-actor-within-distance_topic66089.html
B
18
S
5
G
4
Posts: 568
Reputation: 5,079

Post » Wed Jul 03, 2013 9:12 am

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]
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Wed Jul 03, 2013 1:05 pm

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 large...my 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!!

B
10
S
2
G
2
Posts: 81
Reputation: 1,757

Post » Wed Jul 03, 2013 1:09 pm

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.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775


Return to How do I....?

Who is online

Users browsing this forum: Yahoo [Bot] and 17 guests