Code: Show/Hide 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 */ |
Code: Show/Hide 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. */ }; |
Code: Show/Hide from asss import *
balls = get_interface(I_BALLS) def mm_attach(a): bd = balldata() bd.state = BALL_ONMAP bd.x = bd.y = 512 * 16 bd.xspeed = bd.yspeed= 0 bd.carrier = None bd.freq = -1 bd.time = current_ticks() balls.PlaceBall(a, 0, bd) def mm_detach(a): pass |