2010-01-21 14:45:16 +00:00
|
|
|
/*
|
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope it will be useful, but WITHOUT
|
|
|
|
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
|
|
|
* more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License along with
|
|
|
|
* this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
|
|
|
* Place - Suite 330, Boston, MA 02111-1307 USA.
|
|
|
|
*
|
|
|
|
* Author & Copyright (C) 2010: Soeren Heisrath (forename@surename.org)
|
|
|
|
*
|
|
|
|
*/
|
2010-01-21 21:26:30 +00:00
|
|
|
#include "common.h"
|
2010-01-21 14:45:16 +00:00
|
|
|
|
2010-01-15 12:19:54 +00:00
|
|
|
#ifndef BALL_H
|
|
|
|
#define BALL_H
|
|
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
2010-01-19 09:55:28 +00:00
|
|
|
int16_t x;
|
|
|
|
int16_t y;
|
2010-01-15 12:19:54 +00:00
|
|
|
int16_t dir_x; /* direction vector */
|
|
|
|
int16_t dir_y;
|
|
|
|
uint8_t strength;
|
|
|
|
} ball_t;
|
|
|
|
|
2010-01-21 13:40:40 +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);
|
2010-01-15 12:19:54 +00:00
|
|
|
|
|
|
|
/* @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);
|
2010-01-15 12:19:54 +00:00
|
|
|
#endif /* BALL_H */
|