ajout teleporteurs source files
This commit is contained in:
parent
dbd0855969
commit
eb74acf72c
|
@ -0,0 +1,3 @@
|
|||
build-fx/src/tuyau.c.o: src/tuyau.c include/tuyau.h
|
||||
|
||||
include/tuyau.h:
|
Binary file not shown.
|
@ -0,0 +1,15 @@
|
|||
#ifndef TUYAU_H
|
||||
#define TUYAU_H
|
||||
|
||||
typedef struct
|
||||
{
|
||||
int x, y; // En cases de 8*8
|
||||
int tx, ty; // Targeted coords
|
||||
int key; // Key used (may be 0 if the user doesn't have to press any key)
|
||||
} teleport_t;
|
||||
|
||||
void set_teleporteurs(teleport_t const * const t, int const n);
|
||||
|
||||
void teleport_active(); // Activation des teleporteurs à chaque frame
|
||||
|
||||
#endif
|
|
@ -0,0 +1,22 @@
|
|||
#include <tuyau.h>
|
||||
|
||||
#include <gint/std/string.h>
|
||||
|
||||
static teleport_t teleporteurs[6]={0}; // 6 max
|
||||
static int nombre_teleporteurs=0; // Nombre d'entités utilisés dans le niveau actuel
|
||||
|
||||
void set_teleporteurs(teleport_t const * const t, int const n)
|
||||
{
|
||||
nombre_teleporteurs=0;
|
||||
if (t)
|
||||
{
|
||||
if (n>6)
|
||||
nombre_teleporteurs=6;
|
||||
else
|
||||
nombre_teleporteurs=n;
|
||||
if (nombre_teleporteurs)
|
||||
{
|
||||
memcpy(teleporteurs, t, sizeof(teleport_t)*n);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue