car lane and image overlapping

Get help using Construct 2

Post » Sun Oct 13, 2013 11:08 pm

Hmmm, I hope I can explain this well.
I'm working a game with 4 lanes. Every say 2 seconds I generate images from two different families on any of the four lanes using the choose function(I use two different events for each of the families). But what happens sometimes is the same lane is selected by the two events hence the two images are generated on the same position and overlapping

Any hints on how to handle this exception.   
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Mon Oct 14, 2013 4:16 am

Can you set a "This lane is in use" variable?
when it picks a lane, that lane is checked to see if it's already in use. You unmark them when they become available.
B
242
S
63
G
33
Posts: 903
Reputation: 40,756

Post » Mon Oct 14, 2013 11:15 am

@paradox, thanks but I'm not sure how to implement that. Thinking.. Cld it be assigning no 1 to4 to d variable lane in use depending on which lane was picked and den checking dat for d oda pick image event such that.. I'm stuck. Lemme try n upload a capx file
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Oct 15, 2013 12:12 am

Not a great example but I threw something together real fast:

https://dl.dropboxusercontent.com/u/85412219/Frogger/Frogger.capx

Click on layout 1 and preview it to see Variables preventing spawning for a few seconds.

Click on layout 2 and preview to see another idea where the spawner sprites are extra wide, and new sprites won't spawn while another is still on it.
B
242
S
63
G
33
Posts: 903
Reputation: 40,756

Post » Tue Oct 15, 2013 12:16 am

@paradox here is the capx file showing the problemlane issu
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Oct 15, 2013 12:24 am

@paradox thanks. Had imternet issue since morning so cldn't upload d doc ondropbox, was just uploading this now when d alert came in. I hope the link works cos the internet is bad. Wld try to look @ what u did. Thanks a lot
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Oct 15, 2013 12:25 am

@paradox thanks. Had imternet issue since morning so cldn't upload d doc on dropbox, was just abt to upload when the alert came in. Wld try to look @ what u did. Thanks a lot
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Oct 15, 2013 12:39 am

@paradox!! Wow!! Really cool implementations. Really wish I could think like that. Thanks a lot
B
15
S
4
Posts: 138
Reputation: 2,003

Post » Tue Oct 15, 2013 12:43 am

I had forgot to add the "destroy outside layout" behavior, so the count builds up after awhile. I added it, but I think you got it first.

The wide spawner version makes a nice pattern if you take out the random variance.
B
242
S
63
G
33
Posts: 903
Reputation: 40,756

Post » Wed Oct 16, 2013 12:24 am

@Paradox, sorry but for the second event what is the work of the system random(20)<1?
B
15
S
4
Posts: 138
Reputation: 2,003

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 31 guests