You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

171 lines
3.1 KiB

#ifndef _MOTEUR
#define _MOTEUR
#include "fxlib.h"
#include "MonochromeLib.h"
#include "TouchLib.h"
#define EN_ATTENTE 0
#define LANCEE 1
#define NB_CUTS 7
#define NB_ANIM 3
#define SPEED 23
#define VIT_ANIM_PERDU 20
#define NB_FRUITS_AFFICHES 5
#define INVERSE 1
#define NORMAL 2
#define MONTER 1
#define DESCENDRE 2
#define JEU 0
#define MENU 1
#define JEU_LIBRE 2
#define ARCADE 3
// id des fruits
#define BOMBE 0
#define ANANAS 1
#define PASTEQUE 2
#define FRAISE 3
#define ORANGE 4
#define ETOILE 5
#define NB_FRUITS 6
// pour les anims
#define BONUS_3 1
#define BONUS_4 2
#define BONUS_5 3
#define VIE_PERDUE 4
#define ACHIEVEMENT 5
#define HIGHSCORE 6
#define MULTIPLIER 7
#define P100 0
#define P50 1
#define C3 2
#define C5 3
#define ADDICT 4
#define NOLIFE 5
#define NOBOMBS 6
#define P50ARC 7
#define P100ARC 8
#define P50GSFRUIT 9
#define ITESTED 10
#define P30S 11
#define P60S 12
#define P180S 13
#define SUPERSTAR 14
#define NOVICE 15
#define NB_ACHIEVEMENTS 16
#define TEMPS_MULTIPLIER 200
#define GRAVITE 0.085 // par frame
typedef struct Animation Animation;
struct Animation
{
int type;
int mode;
int temps;
};
typedef struct Vecteur Vecteur;
struct Vecteur
{
int x;
int y;
};
typedef struct Fruit Fruit;
struct Fruit
{
// variables générales
int idImage;
int couper;
int objet;
int afficher;
int mouvement;
// fruit entier
float x;
float y;
float fHor;
float fVer;
// fruit coupe
float bout1x;
float bout1y;
float bout2x;
float bout2y;
float fHor1;
float fVer1;
float fHor2;
float fVer2;
};
typedef struct Combo Combo;
struct Combo
{
int temps;
int nb;
};
struct Cuts
{
int initialisation;
int tempsAfficher;
TL_Point p1;
TL_Point p2;
};
struct Tache
{
int x;
int y;
int radius;
int forceX;
int forceY;
};
void anim_perdu(int bombe_x, int bombe_y, int couleur);
int anim_Arcade(int couleur);
void explosionBigFruit(int x, int y, int couleur);
int CollisionDroiteSeg(TL_Point A, TL_Point B, TL_Point O, TL_Point P);
int CollisionSegSeg(TL_Point A, TL_Point B, TL_Point O, TL_Point P);
int moteur(int type);
int chargerCouleur(void);
void initialiserCouleur(int couleur);
void initialiserHighscore(int score1, int score2);
void chargerHighscore(int *score1, int *score2);
void initialiserAchievements(int *achievements);
void chargerAchievements(int *pAchievements);
int RTC_getTicks(void);
int randInt_a_b(int a, int b);
float randFloat_a_b(float a, float b);
int randInitiateur(void);
void printV(int x, int y, int n);
void printVmini(int x, int y, int n);
void printVxy(int x, int y, int n);
void setFps(int fpsWish);
void sauverTemps(int temps);
int chargerTemps(int *temps);
void saved(void);
void loading(void);
void error(void);
#endif