ajout teleporteurs source files

This commit is contained in:
Milang 2020-01-23 19:54:19 +01:00
parent dbd0855969
commit eb74acf72c
4 changed files with 40 additions and 0 deletions

3
build-fx/src/tuyau.c.d Normal file
View File

@ -0,0 +1,3 @@
build-fx/src/tuyau.c.o: src/tuyau.c include/tuyau.h
include/tuyau.h:

BIN
build-fx/src/tuyau.c.o Normal file

Binary file not shown.

15
include/tuyau.h Normal file
View File

@ -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

22
src/tuyau.c Normal file
View File

@ -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);
}
}
}