Keep a steady train of sprites?

Get help using Construct 2

Post » Tue Nov 13, 2012 11:41 am

Hi, I've got a train of sprites moving around the screen that change direction when they hit certain blocks. It works OK except that if they speed is too high (200 + on the bullet behaviour) they start to get 'out of step'.

I think it's down to the timing of the events, which I think VSYNC would fix. However I can't find a VSYNC setting in C2 (if there even is one). Is VSYNC on by default? Is it that causing the problem, if so, can anyone think of a way to fix it?

Cheers.

TRAIN CAPX
B
19
S
5
G
4
Posts: 208
Reputation: 3,960

Post » Tue Nov 13, 2012 4:11 pm

When colliding the amount the two objects overlap will vary.
One solution would be to back out of the obstacle until not colliding and then turn and moving by the amount backed out.

http://dl.dropbox.com/u/5426011/examples15/train.capx
B
79
S
24
G
52
Posts: 4,725
Reputation: 39,713

Post » Tue Nov 13, 2012 4:38 pm

Ah I get it. So count how many it moves over the block, and move back that many pixels, then use the number counted in the local variable to catch up with the train.

Thanks for that R0j0. :)
B
19
S
5
G
4
Posts: 208
Reputation: 3,960


Return to How do I....?

Who is online

Users browsing this forum: Pandadoor, Zebbi and 25 guests