#include "teleporteur.h" #include "mario.h" #include "keyboard.h" #include #include teleporteur_t *teleporteurs=0; int nombre_teleporteurs=0; static void check_teleporteur(teleporteur_t * t) { if (t->active==0) return; bool x=(mario.p.x<=t->x && mario.p.x+mario.p.w>t->x); bool y=(mario.p.y<=t->y && mario.p.y+mario.p.h>t->y); if (x&&y) { if (t->key==-1) { mario_x_max=0; mario.p.x=t->target_x; mario.p.y=t->target_y; mario.p.vx=0; mario.p.vy=0; sleep_ms(3,500); } else if (keys[t->key]) { mario_x_max=0; mario.p.x=t->target_x; mario.p.y=t->target_y; mario.p.vx=0; mario.p.vy=0; sleep_ms(3,500); } } } void teleporteurs_check() { for (int i=0; i