borgware-2d/games/breakout/ball.h

30 lines
566 B
C
Raw Normal View History

#ifndef BALL_H
#define BALL_H
#include <stdint.h>
#include "common.h"
typedef struct
{
2010-01-19 09:55:28 +00:00
int16_t x;
int16_t y;
int16_t dir_x; /* direction vector */
int16_t dir_y;
uint8_t strength;
} ball_t;
2010-01-15 16:02:31 +00:00
void ball_spawn (ball_t *in_ball, uint16_t in_x, uint16_t in_y, int16_t in_dir_x, int16_t in_dir_y, uint8_t in_strength);
/* @description Called once per game tick. Move the ball further along it's vector.
*/
void ball_think (ball_t *in_ball);
2010-01-15 14:42:46 +00:00
void ball_die (ball_t *in_b);
2010-01-15 16:02:31 +00:00
void ball_draw (ball_t *);
2010-01-19 19:44:16 +00:00
void ball_spawn_default (ball_t *in_b);
#endif /* BALL_H */