Slow movement speeds for background objects.

Started by Glenjamin, Wed 19/08/2015 01:58:32

Previous topic - Next topic

Glenjamin

In my game, I'm making a character walk (It's just an object with the move function) in the background whilst the player stands in the foreground. The only issue is, he moves way to fast.

This is my code.
Code: ags


cshadow.Move(-100, 64, 1, eNoBlock, eAnywhere);


Now a logical thing to do would be put something like 0.5 in for the speed, but obviously that doesn't work. How can I make the object move slower than 1?

Gilbert

For characters, putting a negative number for the speed parameter will make them move slower. I don't know whether objects do the same (they most probably do, but the current explanations in the manual is not very clear, which form a labyrinth of loops, like in Object.Move() it just mentions to refer to Character.Move() for details, and in Character.Move() refer to Character.Walk() and then further points you to the general Characters section) and if that doesn't work for objects, just use a character instead.

Slasher

#2
QuoteFor characters, putting a negative number for the speed parameter will make them move slower. I don't know whether objects do the same
Objects do take negative numbers -

Example (assuming that your cshadow is an object):
Code: ags

cshadow.Move(-100, 64, -10, eNoBlock, eAnywhere); //  -10: will move slowly 






Monsieur OUXX

Mildly relevant: The one annoying thing about idle animations is the delay. It's changed only through script, and when you're a beginner it's hard to find in the help if you don't know what you're looking for.
 

SMF spam blocked by CleanTalk