how do you make objects fall ??

Started by pooja24, Fri 20/03/2009 05:36:55

Previous topic - Next topic

pooja24

well i want some objects to fall and if the character touches them she should die..how does one do this??very new to this ..help would be appreciated.

RickJ

Room objects are similar to characters except that each room has it's own set of unique objects.   In general you use the room editor to create an object, assign a graphic for the object and give it a script name such as oMyObject.  In the room script you would tell each object to move from some point near the top of the screen to some point near the bottom of the screen using a  command like "oMyObject.Move(x,y);".   In the repeatedly execute function you would then check to see if the object collided with  the character  using something like "if (oMyObject.IsCollidingWithChar(player)) DoSomething();".   

If you want the object to be animated while falling then you have to assign a view and loop in the script also using something like "oMyObject.SetFrame(view,loop,frame); and then oMyObject.Animate(...).

There is a limited number of objects in a room (don't know the limit in the latest AGS version but it was around 16 a few versions back).   You can find out from the help file by searching for "system limits".  If you need more objects than the room limit you could just use characters instead.

This ought to give you the general idea and should be enough to get you started and reding in the right parts of the help file.   Ask for more help if you get stuck or have more specific questions.

SMF spam blocked by CleanTalk