Moving an object slower than speed "1" (SOLVED)

Started by Tamanegi, Tue 18/12/2007 23:45:23

Previous topic - Next topic

Tamanegi

I'm using this code to make a cloud of fog (twice the length of the screen) move back and forth:
Code: ags

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"?
Don't Look! MAGS 12-2010
Mediocre Expectations Current development blog

Ashen

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).
I know what you're thinking ... Don't think that.

Tamanegi

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.
Don't Look! MAGS 12-2010
Mediocre Expectations Current development blog

SMF spam blocked by CleanTalk