Code: Show/Hide /* called when a player scores a goal */
#define CB_GOAL "goal" typedef void (*GoalFunc)(Arena *arena, Player *p, int bid, int x, int y); /* pycb: arena, player, int, int, int */ struct BallData { /* pytype: struct, struct BallData, balldata */ int state; /* the state of this ball */ int x, y, xspeed, yspeed; /* the coordinates of the ball */ Player *carrier; /* the player that is carrying or last touched the ball */ int freq; /* freq of carrier */ ticks_t time; /* the time that the ball was last fired (will be 0 for * balls being held). for BALL_WAITING, this time is the * time when the ball will be re-spawned. */ }; void (*PlaceBall)(Arena *arena, int bid, struct BallData *newpos); /* sets the parameters of the ball to those in the given BallData * struct */ /* pyint: arena, int, balldata -> void */ |
Quote: |
ball.state = BALL_ONMAP
ball.x = 512 * 16 ball.y = 512 * 16 ball.carrier = None ball.freq = -1 ball.time = ??? # same as(?) ball = ( BALL_ONMAP, 512 * 16, 512 * 16, None, -1, 0 ) balls.PlaceBall(arena, bid, ball) |