Author Topic: MODULE: animObjs: move groups of objects around with one function  (Read 236 times)

animObjs


Here is an animation system I rigged together because wanted to animate layers of mist easily.
Incidentally, I over-built it.


HOW TO USE:
Put one or more of these functions in a repeated_execute function:

Code: Adventure Game Studio
  1. animObjs( animObjs_Objs( object1.ID, object2.ID, ... ),
  2.     //Don't use the same location twice
  3.             animObjs_SXYs( speed1, x1, y1,
  4.                 speed2, x2, y2,
  5.                 speed3, x3, y3
  6.                 speed4, x4, y4 ),
  7.             animObjs_SXYs( speed5, x5, y5,
  8.                 etc., etc., etc ),  
  9.         animObjs_SXYs( ));

The above will cause object1 and object2 to go to points x1 y1 at speed1,
then, once that is reached, x2 y2 at speed2
etc. etc.

The minimum needed to run this is:

Code: Adventure Game Studio
  1. animObjs( animObjs_Objs( object1.ID),
  2.     //Don't use the same location twice
  3.             animObjs_SXYs( speed1, x1, y1 ),
  4.             animObjs_SXYs(  ),  
  5.         animObjs_SXYs( ));

It also includes 'animObjs_relativeToObjStrt()' which works like animObjs
but moves the objects relative to objects start
(this one won't work for solid objects, but can make a roomful of clocks in minutes.)

More instructions can be found on the readme on github.

Enjoy!
(written in (AGS 3.3)