Adventure Game Studio

AGS Support => Beginners' Technical Questions => Topic started by: Tamanegi on Tue 18/12/2007 23:45:23

Title: Moving an object slower than speed "1" (SOLVED)
Post by: Tamanegi on Tue 18/12/2007 23:45:23
I'm using this code to make a cloud of fog (twice the length of the screen) move back and forth:

if (oFog1.Moving==false) {
  if (move1left==1) {
    oFog1.Move(0, 180, 1, eNoBlock, eAnywhere);
    move1left=0;    } else {
      oFog1.Move(-320, 180, 1, eNoBlock, eAnywhere);
      move1left=1;         }
                       }


It works just great and stuff, but it is way too fast! Is there a way (besides more complicated interrupting/resuming of movement) to make an object move slower than speed "1"?
Title: Re: Moving an object slower than speed "1"
Post by: Ashen on Wed 19/12/2007 00:00:16
It's not immediately obvious, but since the manual entry for Object.Move says:
Quote
It will move at speed SPEED, which uses the same scale as the character Walk Speed values in the AGS Editor.

This means that, like Walk Speed, you can use a negative value for slower than 1. I think they're equivilant to '1/x', so -2 is 1/2 the speed of 1, -3 is 1/3 the speed, etc (-1 would be 1/1 - and does seem to be the same as 1).
Title: Re: Moving an object slower than speed "1"
Post by: Tamanegi on Wed 19/12/2007 00:15:00
It's exactly as you said...  :D I would have expected it to give some kind of error or misbehavior with negative speed. This is almost too well-thought and convenient.