Okay, I'll try my best to make this clear.
Dragon->Collide(Ghost)->Script Editor
- Code: Select all
int RAND = rand(2);
switch (RAND)
{
case 0:
ChangeAnimation("Event Actor", "Bite", FORWARD;
ChangeAnimation("Collide Actor", "Jump", FORWARD;
break;
case 1:
ChangeAnimation("Event Actor", "Scratch", FORWARD;
ChangeAnimation("Collide Actor", "Block", FORWARD;
break;
}
The two, is the number of animations you want, it picks a random number, 0 or 1, in this case. Then the switch will change the animations according to the number. The dragon will bite, and the ghost will jump. And so on... I suggest commenting your code, it is meant to make it easier to read, the reason I used them in my previous example was I don't know what the ChangeAnimation will change to, as it was not my game. It is to show where the ChangeAnimation will go.