From 858f01dedbb681c8e62c9dae4d7c3174991844bf Mon Sep 17 00:00:00 2001 From: oroborus Date: Fri, 7 Mar 2008 21:12:57 +0000 Subject: -podpora teleportov -podpora rur git-svn-id: http://opensvn.csie.org/tuxanci_ng@9 0ee4d065-81f0-4d1e-b06c-ff20ad07cc3e --- include/arena.h | 4 ++++ include/pipe.h | 36 ++++++++++++++++++++++++++++++++++++ include/shot.h | 7 +++++-- include/teleport.h | 31 +++++++++++++++++++++++++++++++ include/tux.h | 5 +++-- 5 files changed, 79 insertions(+), 4 deletions(-) create mode 100644 include/pipe.h create mode 100644 include/teleport.h (limited to 'include') diff --git a/include/arena.h b/include/arena.h index 59290fd..38a0a18 100644 --- a/include/arena.h +++ b/include/arena.h @@ -10,11 +10,15 @@ typedef struct arena_struct { char music[STR_SIZE]; + SDL_Surface *background; + list_t *listTux; list_t *listShot; list_t *listWall; list_t *listItem; + list_t *listTeleport; + list_t *listPipe; } arena_t; extern arena_t* newArena(); diff --git a/include/pipe.h b/include/pipe.h new file mode 100644 index 0000000..e665e0a --- /dev/null +++ b/include/pipe.h @@ -0,0 +1,36 @@ + +#ifndef PIPE_H + +#define PIPE_H + +#include "interface.h" +#include "list.h" + +typedef struct pipe_struct +{ + int x; // poloha steny + int y; + + int w; // rozmery steny + int h; + + int id; + int id_out; + int position; + + int layer; // vrstva + + SDL_Surface *img; //obrazok +} pipe_t; + +extern pipe_t* newPipe(int x, int y, int w, int h, int layer, + int id, int id_out, int position, SDL_Surface *img); + +extern void drawPipe(pipe_t *p); +extern void drawListPipe(list_t *listPipe); +extern pipe_t* isConflictWithListPipe(list_t *listPipe, int x, int y, int w, int h); +extern void eventConflictShotWithPipe(list_t *listPipe, list_t *listShot); +extern void destroyPipe(pipe_t *p); + +#endif + diff --git a/include/shot.h b/include/shot.h index c248538..749767f 100644 --- a/include/shot.h +++ b/include/shot.h @@ -19,8 +19,7 @@ typedef struct shot_struct int px; int py; - int course; - int speed; + int position; int gun; tux_t *author; @@ -36,6 +35,10 @@ extern void drawShot(shot_t *p); extern void drawListShot(list_t *listShot); extern int isConflictWithListShot(list_t *listShot, int x, int y, int w, int h); extern void eventMoveListShot(list_t *listShot); + +extern void moveShot(shot_t *shot, int position, int src_x, int src_y, + int dist_x, int dist_y, int dist_w, int dist_h); + extern void destroyShot(shot_t *p); extern void quitShot(); diff --git a/include/teleport.h b/include/teleport.h new file mode 100644 index 0000000..4b9ed66 --- /dev/null +++ b/include/teleport.h @@ -0,0 +1,31 @@ + +#ifndef TELEPORT_H + +#define TELEPORT_H + +#include +#include "list.h" + +typedef struct teleport_struct +{ + int x; // poloha steny + int y; + + int w; // rozmery steny + int h; + + int layer; // vrstva + + SDL_Surface *img; //obrazok +} teleport_t; + +extern teleport_t* newTeleport(int x, int y, int w, int h, int layer, SDL_Surface *img); +extern void drawTeleport(teleport_t *p); +extern void drawListTeleport(list_t *listTeleport); +extern teleport_t* isConflictWithListTeleport(list_t *listTeleport, int x, int y, int w, int h); +extern void eventConflictShotWithTeleport(list_t *listTeleport, list_t *listShot); +extern void eventTeleportTux(list_t *listTeleport, teleport_t *teleport, tux_t *tux); +extern void destroyTeleport(teleport_t *p); + +#endif + diff --git a/include/tux.h b/include/tux.h index ed5e01e..ebc8ac7 100644 --- a/include/tux.h +++ b/include/tux.h @@ -10,7 +10,7 @@ #define TUX_LAYER 0 #define TUX_MAX_ANIMATION_FRAME 10 #define TUX_MAX_PICKUP 50 -#define TUX_MAX_BONUS 250 +#define TUX_MAX_BONUS 500 #define TUX_TIME_SPAWN 2000 #define TUX_TIME_CAN_SHOT 500 @@ -107,7 +107,8 @@ extern void drawListTux(list_t *listTux); extern void eventTuxIsDead(tux_t *tux); extern tux_t* isConflictWithListTux(list_t *listTux, int x, int y, int w, int h); extern int isConflictTuxWithListTux(tux_t *tux, list_t *listTux); -extern void eventConflictShotWithTux(list_t *listTux, list_t *listShot); +extern void eventConflictTuxWithShot(list_t *listTux, list_t *listShot); +extern void eventConflictTuxWithTeleport(list_t *listTux, list_t *listTeleport); extern void tuxTeleport(tux_t *tux); extern void actionTux(tux_t *tux, int action); extern void eventListTux(list_t *listTux); -- cgit v1.2.3