For example, in a game I'm making, the main character can squish down and slide under small areas, and if the ceiling is too low, the character won't pop back up to normal size unless there is enough room.
- Code: Select all
switch(state)
{
case 8:
case 10:
if (CollisionFree("Event Actor", x, y-5))
{
ChangeAnimation("Event Actor", "floober_shlop_right1", NO_CHANGE);
state=12;
}
break;
case 9:
case 11:
if (CollisionFree("Event Actor", x, y-5))
{
ChangeAnimation("Event Actor", "floober_shlop_left1", NO_CHANGE);
state=13;
}
break;
}
BUT, because of this, if there is any object I am passing by, say a lamp post for example, or a plant, or any background object, I am still unable to pop up off of the ground due to the fact that this collisionfree event isn't specified, it applies to all objects in-game.
I would greatly appreciate it if anyone could help me develop a new variable just like CollisionFree, but with one extra option. Here's the basic idea:
- Code: Select all
int CollisionFree2(char *actorName, int x, int y, //name of collision actor )
also, if anyone wouldn't mind telling me, what is char, does char refer to the main character? and what is actorName? I don't see that defined anywhere at all? And why would you multiply char by actorName? XD
Sorry for all of these questions, and thanks for the help guys!