First one is a toggle function.
- Code: Select all
int Toggle(int integer)
{
return !integer;
}
You can use it to toggle and integer or other things. Like this would switch an actor from transparent to visible or vise versa
- Code: Select all
transp = Toggle(transp);
Another could be PointFromCircle
- Code: Select all
void PointFromCircle(char * circles, int radius)
{
Actor * circle = getclone(circles);
theta = direction(circle->x - view.x, circle->y - view.y, xmouse, ymouse)/60;
x = circle->x+radius*cos(-theta);
y = circle->y+radius*sin(-theta);
}
You can use it to have an actor point at the mouse (or change the mouse to anything else if you want) and stay on a circle paths, not nearly as universal but it could help someone
- Code: Select all
PointFromCircle("circle", 50);
This would have the actor point towards the mouse around the actor named circle with a radius of 50 pixels. You could use it if you made a soccer like game and the player moved towards the mouse, then the ball would be in the right spot for dribbling!
Now post some more!