Discuss Scratch

simonc8
Scratcher
43 posts

Synchronising movement of sprites

This post references project synch problem.

It's a platform game where a player jumps from one platform to another. The “ghost” sprites are smaller than the platform sprites, and for the player to be safe it has to be touching one of the ghost sprites. The requirement is that the ghost sprite positions have to match the platform sprites at all times.

I have set up forever loops for the ghost sprites to go to the positions of the platform sprites, but there is clearly a serious lag, so the ghost sprites are constantly shifting relative to the platforms. What is causing this? Is there a better way of locking the ghost sprite positions to the platforms?

Grateful for advice.
deck26
Scratcher
1000+ posts

Synchronising movement of sprites

You probably need to move the player and then broadcast to move the other sprites. If you just use forever loops you're not controlling the order they run within the frame so, for example, a ghost may move before the player moves.
simonc8
Scratcher
43 posts

Synchronising movement of sprites

Many thanks deck26. That has resolved the problem.

Powered by DjangoBB