If I ever try to make an object's position stay with another object it always trails it a few pixels behind if the location moves too fast, can fastloop make the object stick to another no matter the speed?
For instance : always set "pistol" position to "man1". Except for "pistol" cant keep up with "man1".
I would check for myself but I don't know how to use fast loop and I only want to learn if it helps me with that.
n/a
Pete Nattress Cheesy Bits img src/uploads/sccheesegif
Registered 23/09/2002
Points 4811
28th March, 2004 at 06:55:40 -
i have this problem myself. using fastloop does notably reduce it but doesn't get rid of it entirely. use the event:
+User Holds Direction Key
-Start loop "setpos" for 100 loops
+On loop "setpos"
-Set position of object1 to position of object2.
however, do remove it further you might have to tewaek around with where you set its position e.g. "set x of object1 to x of object2 - 2" or something.
If you have a scrolling game, you'll notice that the gun doesn't have any latency while the player is in the middle and the screen is scrolling, only at the edges. If so, make the player start somewhere not close to the edges and make a wall or something so that you can't walk close to the edge of the screen
Argh! Fastloop doesn't make things faster! It only does a number of events a number of times instantly. If you made your origional movement AND the other object on the same loop they should stay together.
Repeat whilst pressing right:
- Start loop right
On loop right
- Xpos of Player +1
- Set Xpos of object2 to player
- Set Ypos of object2 to player
It moves to the position last shown. -Yes
It is one frame behind everything else. -No
It would be positioned in the right spot, then everything redrawn. The problem is not using a custom platform movement.(as speed positions are hard to measure)