FruitNinja/src/moteur.c

1770 lines
78 KiB
C
Executable File

#include "moteur.h"
int ini = 124963565;
int moteur(int type)
{
/** SPRITES ET INITIALISATION **/
const unsigned char Svie[] = {0x88, 0x50, 0x20, 0x50, 0x88};
const unsigned char bonus3[] = {0x00, 0x00, 0x00, 0xFC, 0x01, 0x8E, 0x01, 0x06, 0x00, 0x06, 0x30, 0x0C, 0x30, 0x10, 0xFD, 0xE0, 0xFD, 0xF8, 0x30, 0x3C, 0x30, 0x0C, 0x00, 0x0C, 0x04, 0x08, 0x0E, 0x10, 0x07, 0xE0, 0x00, 0x00};
const unsigned char bonus4[] = {0x00, 0x00, 0x00, 0x03, 0x00, 0x07, 0x00, 0x0A, 0x00, 0x16, 0x30, 0x26, 0x30, 0x46, 0xFC, 0x84, 0xF9, 0x0C, 0x36, 0x0C, 0x2F, 0xFC, 0x0F, 0xFF, 0x00, 0x08, 0x00, 0x18, 0x00, 0x7E, 0x00, 0x00};
const unsigned char bonus5[] = {0x00, 0x00, 0x00, 0x7F, 0x00, 0xFF, 0x00, 0x80, 0x00, 0x80, 0x30, 0x80, 0x30, 0xF8, 0xFD, 0xFC, 0xFC, 0x0E, 0x30, 0x06, 0x30, 0x06, 0x00, 0x06, 0x02, 0x0C, 0x07, 0x18, 0x03, 0xE0, 0x00, 0x00};
const unsigned char newa[] = {0xFF, 0xFF, 0x80, 0x00, 0x00, 0x60, 0x00, 0x18, 0x20, 0x00, 0x30, 0x10, 0x10, 0x60, 0x10, 0x18, 0xE0, 0x10, 0x0E, 0xC0, 0x10, 0x07, 0xF0, 0x10, 0x03, 0xF8, 0x10, 0x00, 0xDC, 0x10, 0x01, 0xC6, 0x10, 0x01, 0x82, 0x10, 0x03, 0x00, 0x10, 0x06, 0x00, 0x20, 0x00, 0x00, 0x60, 0xFF, 0xFF, 0x80};
const unsigned char newhs[] = {0xFF, 0xFF, 0x80, 0x00, 0x00, 0x60, 0x17, 0xFA, 0x20, 0x2C, 0x0D, 0x10, 0x24, 0x09, 0x10, 0x12, 0x12, 0x10, 0x0A, 0x14, 0x10, 0x07, 0x38, 0x10, 0x00, 0xC0, 0x10, 0x00, 0xC0, 0x10, 0x00, 0xC0, 0x10, 0x00, 0xC0, 0x10, 0x01, 0xE0, 0x10, 0x03, 0xF0, 0x20, 0x00, 0x00, 0x60, 0xFF, 0xFF, 0x80};
const unsigned char foisdeux[] = {0xff,0xff,0x80,0x0,0x0,0x60,0x0,0xf,0x20,0x0,0x19,0x90,0x0,0x30,0x90,0x0,0x20,0x90,0x62,0x1,0x90,0x36,0x3,0x10,0x1c,0x6,0x10,0x38,0xc,0x10,0x6c,0x18,0x10,0x46,0x30,0x10,0x0,0x61,0x10,0x0,0x7f,0x20,0x0,0x0,0x60,0xff,0xff,0x80};
const unsigned char bggameover[]={0xf,0xff,0xc0,0x1f,0xff,0xef,0xff,0xfc,0x0,0x0,0x0,0xff,0xfe,0x0,0x3f,0xf0,0x30,0x0,0x3f,0xe0,0x0,0x10,0x0,0x3,0xff,0xff,0xff,0x0,0x1,0xff,0xc0,0xc,0x47,0xff,0x80,0xf,0xff,0xc7,0xff,0xf8,0x0,0x0,0x0,0x7f,0xfc,0x0,0x1f,0xe2,0x58,0x0,0x7f,0xf0,0x0,0x38,0x0,0x7,0xff,0xdf,0xff,0x80,0x3,0xff,0xe0,0x1a,0x90,0x0,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x9,0xa0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x20,0x0,0x0,0x0,0x0,0x0,0x5,0xa0,0x0,0x3f,0x0,0x0,0x40,0x0,0x0,0x0,0x10,0x0,0x0,0x0,0x0,0x0,0x5,0xa0,0x0,0xe7,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5,0xa0,0x1,0x80,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5,0xa0,0x3,0x0,0xf,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0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5,0xa0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5,0xa0,0x2,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x5,0xa0,0x4,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x4,0x0,0x0,0x5,0x90,0x4,0x0,0x0,0x0,0x0,0x0,0x40,0x0,0x0,0x0,0x0,0x8,0x0,0x0,0x9,0x58,0xe,0x0,0x1,0x0,0x0,0xff,0xbf,0xff,0x80,0x0,0x0,0x8,0x0,0x0,0x1a,0x47,0xf1,0xff,0xfe,0xff,0xff,0x0,0x0,0x0,0x7f,0xff,0xff,0xff,0xff,0xff,0xe2,0x30,0x4,0x0,0x0,0x0,0x0,0x7f,0xff,0xff,0x0,0x0,0x0,0x0,0x0,0x0,0xc,0xf,0xfb,0xff,0xff,0xff,0xff,0x80,0x0,0x0,0xff,0xff,0xff,0xff,0xff,0xff,0xf0};
const unsigned char past1[] = {0x00, 0x00, 0x3F, 0x00, 0x78, 0xC0, 0x5F, 0xB0, 0xC7, 0xC8, 0xE1, 0xF4, 0xE0, 0x7A, 0xF0, 0x3E, 0x78, 0x1D, 0x7C, 0x0D, 0x3F, 0x07, 0x1F, 0xC3, 0x0F, 0xFA, 0x03, 0xFE, 0x00, 0x7C, 0x00, 0x00};
const unsigned char past2[] = {0x00, 0x00, 0x3E, 0x00, 0x67, 0xC0, 0x60, 0xF0, 0xF8, 0x78, 0xBC, 0x1C, 0xDF, 0x0E, 0xDF, 0x86, 0x6F, 0xE3, 0x67, 0xF3, 0x31, 0xF9, 0x18, 0xFD, 0x0E, 0x3A, 0x03, 0x86, 0x00, 0xFC, 0x00, 0x00};
const unsigned char past3[] = {0x07, 0x00, 0x3F, 0xC0, 0x67, 0xE0, 0x61, 0xF0, 0x70, 0x78, 0xF8, 0x3C, 0xBC, 0x1E, 0xBE, 0x0E, 0x5F, 0x0F, 0x5F, 0x87, 0x2F, 0xC7, 0x17, 0xE2, 0x0B, 0xF2, 0x04, 0xFE, 0x03, 0x3C, 0x00, 0xE0};
const unsigned char past4[] = {0x00, 0x00, 0x06, 0x00, 0x3F, 0xC0, 0x60, 0xF0, 0xFE, 0x1C, 0xBF, 0xCE, 0x9F, 0xE6, 0xC7, 0xF3, 0xE1, 0xF9, 0x70, 0x7D, 0x78, 0x19, 0x3E, 0x03, 0x0F, 0xCE, 0x03, 0xFC, 0x00, 0x60, 0x00, 0x00};
const unsigned char past5[] = {0x0F, 0x00, 0x3C, 0xC0, 0x67, 0xA0, 0x73, 0xD0, 0x71, 0xE8, 0x70, 0xE8, 0x78, 0x74, 0x38, 0x3C, 0x3C, 0x3A, 0x3C, 0x1A, 0x1E, 0x1A, 0x1F, 0x0E, 0x0F, 0x8E, 0x07, 0xE6, 0x03, 0xFC, 0x00, 0xF0};
const unsigned char past6[] = {0x0F, 0x80, 0x18, 0xE0, 0x32, 0x70, 0x37, 0x30, 0x27, 0x98, 0x63, 0xC8, 0x73, 0xEC, 0x31, 0xEC, 0x31, 0xE4, 0x38, 0xF6, 0x18, 0xF6, 0x1C, 0x74, 0x0E, 0x74, 0x0F, 0x3C, 0x07, 0x98, 0x01, 0xF0};
const unsigned char past7[] = {0x0F, 0x00, 0x33, 0xC0, 0x68, 0xE0, 0x5C, 0x70, 0x5E, 0x38, 0x5F, 0x18, 0x4F, 0x1C, 0x6F, 0x8C, 0x27, 0xC4, 0x33, 0xC6, 0x13, 0xE6, 0x19, 0xF2, 0x0C, 0xF2, 0x07, 0x3E, 0x03, 0xDC, 0x00, 0xF0};
const unsigned char past8[] = {0x07, 0x00, 0x3F, 0xC0, 0x67, 0xE0, 0x61, 0xF0, 0x70, 0x78, 0xF8, 0x3C, 0xBC, 0x1E, 0xBE, 0x0E, 0x5F, 0x0F, 0x5F, 0x87, 0x2F, 0xC7, 0x17, 0xE2, 0x0B, 0xF2, 0x04, 0xFE, 0x03, 0x3C, 0x00, 0xE0};
const unsigned char bombe1[] = {0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0xB3, 0xF0, 0xFF, 0xFC, 0xFF, 0xFC, 0xFF, 0xFE, 0xFF, 0xFE, 0xFF, 0xFE, 0x19, 0xFE, 0x19, 0xFE, 0x19, 0xBE, 0x08, 0x1C, 0x0E, 0x3C, 0x03, 0xF0, 0x00, 0x00};
const unsigned char bombe2[] = {0x38, 0x00, 0x39, 0x00, 0x1F, 0x00, 0x7F, 0x00, 0x3F, 0xE0, 0x1F, 0xF8, 0x1F, 0xF8, 0x3C, 0xFC, 0x38, 0xFC, 0x29, 0xFC, 0x23, 0xFC, 0x30, 0xFC, 0x24, 0x3C, 0x13, 0x78, 0x1B, 0xF8, 0x07, 0xE0};
const unsigned char bombe3[] = {0x00, 0x38, 0x01, 0x38, 0x01, 0xF0, 0x01, 0xFC, 0x0F, 0xF8, 0x3F, 0xF0, 0x3B, 0xF0, 0x79, 0xF8, 0x79, 0x18, 0x7C, 0x38, 0x70, 0xF8, 0x62, 0x78, 0x7E, 0x78, 0x3F, 0x70, 0x3F, 0xF0, 0x0F, 0xC0};
const unsigned char bombe4[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x1F, 0x9B, 0x79, 0xFF, 0x43, 0xFF, 0xD0, 0xFC, 0xE4, 0x7C, 0xE6, 0x7E, 0xCF, 0xF0, 0xEF, 0xF0, 0xFF, 0xF0, 0x7F, 0xE0, 0x7F, 0xE0, 0x1F, 0x80, 0x00, 0x00};
const unsigned char bombe5[] = {0x00, 0x00, 0x1F, 0x80, 0x78, 0xE0, 0x70, 0x20, 0xFB, 0x30, 0xFF, 0x30, 0xFF, 0x30, 0xFF, 0xFE, 0xFF, 0xFC, 0xFF, 0xFC, 0x7F, 0xFF, 0x7F, 0xFF, 0x1F, 0x9B, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00};
const unsigned char bombe6[] = {0x0F, 0xC0, 0x3F, 0xF0, 0x3F, 0xF0, 0x7F, 0xF8, 0x7F, 0xF8, 0x7F, 0xF8, 0x7F, 0xF8, 0x7F, 0xF8, 0x7F, 0xF8, 0x3F, 0xF0, 0x3F, 0xF0, 0x0F, 0xF8, 0x01, 0xFC, 0x01, 0xF0, 0x01, 0x38, 0x00, 0x38};
const unsigned char bombe7[] = {0x03, 0xF0, 0x0F, 0xFC, 0x0F, 0xFC, 0x1F, 0xFE, 0x1F, 0xFE, 0x1F, 0xFE, 0x1F, 0xFE, 0x1F, 0xFE, 0x1F, 0xFE, 0x0F, 0xFC, 0x0F, 0xFC, 0x1F, 0xF0, 0x3F, 0x80, 0x0F, 0x80, 0x1C, 0x80, 0x1C, 0x00};
const unsigned char bombe8[] = {0x00, 0x00, 0x01, 0xF8, 0x07, 0xFE, 0x07, 0xFE, 0x0F, 0xFF, 0x0F, 0xFF, 0x0F, 0xFF, 0x7F, 0xFF, 0x3F, 0xFF, 0x3F, 0xFF, 0xFF, 0xFE, 0xFF, 0xFE, 0xD9, 0xF8, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00};
const unsigned char ananas1[] = {0x02, 0x54, 0x02, 0xF4, 0x03, 0xE8, 0x01, 0xF8, 0x01, 0xF0, 0x07, 0x20, 0x04, 0x90, 0x0B, 0x68, 0x0E, 0xB8, 0x17, 0xE8, 0x1A, 0xB8, 0x1D, 0x58, 0x17, 0xE8, 0x1D, 0x50, 0x0A, 0xB0, 0x07, 0xE0};
const unsigned char ananas2[] = {0x00, 0x00, 0x00, 0x40, 0x01, 0x60, 0x04, 0xF4, 0x03, 0xF8, 0x05, 0x70, 0x0D, 0xB8, 0x1F, 0x68, 0x1B, 0xB8, 0x16, 0x58, 0x15, 0xB8, 0x1D, 0x58, 0x0A, 0xB0, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00};
const unsigned char ananas3[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x0E, 0xF0, 0x15, 0x58, 0x1D, 0xE8, 0x28, 0xFC, 0x17, 0xF8, 0x38, 0xF8, 0x16, 0xA8, 0x15, 0x38, 0x1A, 0xD0, 0x07, 0x60, 0x04, 0x80, 0x00, 0x00};
const unsigned char ananas4[] = {0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x0A, 0xB0, 0x1D, 0x58, 0x15, 0xB8, 0x16, 0x58, 0x1B, 0xB8, 0x1F, 0x68, 0x0D, 0xB8, 0x05, 0x70, 0x03, 0xF8, 0x04, 0xF4, 0x01, 0x60, 0x00, 0x40, 0x00, 0x00};
const unsigned char ananas5[] = {0x07, 0xE0, 0x0A, 0xB0, 0x1D, 0x50, 0x17, 0xE8, 0x1D, 0x58, 0x1A, 0xB8, 0x17, 0xE8, 0x0E, 0xB8, 0x0B, 0x68, 0x04, 0x90, 0x07, 0x20, 0x01, 0xF0, 0x01, 0xF8, 0x03, 0xE8, 0x02, 0xF4, 0x02, 0x54};
const unsigned char ananas6[] = {0x00, 0x00, 0x00, 0x00, 0x07, 0xE0, 0x08, 0xB0, 0x1D, 0xF8, 0x16, 0x98, 0x15, 0xF8, 0x1B, 0x58, 0x1D, 0x68, 0x0D, 0xB8, 0x06, 0xD0, 0x03, 0xB8, 0x04, 0xF4, 0x01, 0x60, 0x00, 0x40, 0x00, 0x00};
const unsigned char ananas7[] = {0x00, 0x00, 0x04, 0x80, 0x07, 0x60, 0x1A, 0xD0, 0x15, 0x38, 0x16, 0xC8, 0x3A, 0xB8, 0x15, 0x28, 0x2A, 0xB8, 0x1F, 0xE8, 0x15, 0xA8, 0x0E, 0xF0, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
const unsigned char ananas8[] = {0x00, 0x00, 0x00, 0x40, 0x01, 0x60, 0x04, 0xF4, 0x03, 0xB8, 0x06, 0xD0, 0x0D, 0xB8, 0x1D, 0x68, 0x1B, 0x58, 0x15, 0xF8, 0x16, 0x98, 0x1D, 0xF8, 0x08, 0xB0, 0x07, 0xE0, 0x00, 0x00, 0x00, 0x00};
const unsigned char fraise1[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xE0, 0x07, 0x70, 0x1F, 0xDC, 0x17, 0xFE, 0x1E, 0xFC, 0x0F, 0xFE, 0x05, 0xDF, 0x03, 0xFC, 0x00, 0xF6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
const unsigned char fraise2[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0x0F, 0xF0, 0x17, 0x78, 0x1D, 0xED, 0x0F, 0xFF, 0x0F, 0x7F, 0x07, 0xFE, 0x03, 0xDE, 0x01, 0xFF, 0x00, 0x13, 0x00, 0x10, 0x00, 0x00};
const unsigned char fraise3[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x07, 0xB0, 0x05, 0xF8, 0x07, 0xFC, 0x06, 0xEC, 0x07, 0xFC, 0x07, 0xFE, 0x07, 0x7F, 0x03, 0xFE, 0x00, 0x7C, 0x00, 0xEC, 0x00, 0x48};
const unsigned char fraise4[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x05, 0x80, 0x0F, 0xC0, 0x0E, 0xE0, 0x1B, 0xE0, 0x1F, 0xF0, 0x1F, 0xB0, 0x1D, 0xF0, 0x0F, 0xF0, 0x07, 0xE0, 0x07, 0xE0, 0x0D, 0x90, 0x00, 0x80};
const unsigned char fraise5[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0xC0, 0x03, 0x40, 0x07, 0xE0, 0x0B, 0xE0, 0x0E, 0xF0, 0x1F, 0xD0, 0x1F, 0xF0, 0x1B, 0xB0, 0x1F, 0xE0, 0x0F, 0xC0, 0x1F, 0xC0, 0x16, 0x80, 0x04, 0x00};
const unsigned char fraise6[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x80, 0x07, 0xC0, 0x0E, 0xE0, 0x0F, 0xA0, 0x1F, 0xF0, 0x1B, 0xF0, 0x1F, 0xB0, 0x0E, 0xF0, 0x07, 0xF0, 0x07, 0xE0, 0x0F, 0xB0, 0x05, 0x80, 0x00, 0x00};
const unsigned char fraise7[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x80, 0x0B, 0xE0, 0x0F, 0xB0, 0x0F, 0xF8, 0x0E, 0xF8, 0x0F, 0xE8, 0x07, 0xF8, 0x06, 0xFC, 0x03, 0xF8, 0x00, 0x7C, 0x00, 0x68, 0x00, 0x40, 0x00, 0x00};
const unsigned char fraise8[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0xC0, 0x0D, 0xF0, 0x1F, 0x78, 0x1F, 0xEC, 0x0D, 0xFF, 0x0F, 0xFF, 0x07, 0xBC, 0x03, 0xFE, 0x00, 0xBA, 0x00, 0x30, 0x00, 0x00, 0x00, 0x00};
const unsigned char orange1[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x30, 0x4, 0x20, 0x4, 0x20, 0x4, 0x34, 0xc, 0x16, 0x8, 0x18, 0x18, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char orange2[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x30, 0xc, 0x28, 0x4, 0x2c, 0x4, 0x30, 0xc, 0x10, 0x8, 0x18, 0x18, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char orange3[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x38, 0xc, 0x2c, 0x4, 0x20, 0x4, 0x30, 0xc, 0x10, 0x8, 0x18, 0x18, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char orange4[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x34, 0xc, 0x26, 0x4, 0x20, 0x4, 0x30, 0xc, 0x10, 0x8, 0x18, 0x18, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char orange5[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x30, 0xc, 0x21, 0x4, 0x21, 0x84, 0x30, 0xc, 0x10, 0x8, 0x18, 0x18, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char orange6[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x30, 0xc, 0x20, 0x4, 0x20, 0x4, 0x30, 0x8c, 0x10, 0xc8, 0x18, 0x18, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char orange7[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x30, 0xc, 0x20, 0x4, 0x20, 0x4, 0x30, 0xc, 0x10, 0x88, 0x18, 0xd8, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char orange8[] = {0x0, 0x0, 0x0, 0x0, 0x3, 0xc0, 0xe, 0x70, 0x18, 0x18, 0x10, 0x8, 0x30, 0xc, 0x20, 0x4, 0x20, 0x4, 0x30, 0xc, 0x11, 0x8, 0x19, 0x98, 0xe, 0x70, 0x3, 0xc0, 0x0, 0x0, 0x0, 0x0};
const unsigned char etoile1[] = {0x00, 0x00, 0x01, 0x80, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x7C, 0x3E, 0x40, 0x02, 0x20, 0x04, 0x10, 0x08, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x11, 0x88, 0x16, 0x68, 0x18, 0x18, 0x00, 0x00};
const unsigned char etoile2[] = {0x00, 0x00, 0x06, 0x00, 0x05, 0x00, 0x04, 0x8E, 0x04, 0x72, 0x04, 0x04, 0x38, 0x04, 0x40, 0x08, 0x40, 0x08, 0x38, 0x04, 0x04, 0x04, 0x04, 0x72, 0x04, 0x8E, 0x05, 0x00, 0x06, 0x00, 0x00, 0x00};
const unsigned char etoile3[] = {0x00, 0x00, 0x18, 0x18, 0x16, 0x68, 0x11, 0x88, 0x08, 0x10, 0x08, 0x10, 0x08, 0x10, 0x10, 0x08, 0x20, 0x04, 0x40, 0x02, 0x7C, 0x3E, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x01, 0x80, 0x00, 0x00};
const unsigned char etoile4[] = {0x00, 0x00, 0x00, 0x60, 0x00, 0xA0, 0x71, 0x20, 0x4E, 0x20, 0x20, 0x20, 0x20, 0x1C, 0x10, 0x02, 0x10, 0x02, 0x20, 0x1C, 0x20, 0x20, 0x4E, 0x20, 0x71, 0x20, 0x00, 0xA0, 0x00, 0x60, 0x00, 0x00};
const unsigned char peacefull[]={0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x7,0xe1,0xf8,0x18,0x1c,0x1f,0x9f,0xc0,0x3,0x1,0x80,0x0,0x1,0xb3,0x0,0x38,0x36,0x30,0xc,0x18,0x66,0x3,0x0,0x0,0x3,0x1b,0x0,0x6c,0x66,0x30,0xc,0x18,0xc6,0x3,0x0,0x0,0x3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54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xA1, 0x50, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0xA0, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xA1, 0x50, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x52, 0xA9, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x21, 0x10, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
int time = 0, i, j, k, couleur, perdu = 0, vie = 0, difficulte = 0;
int bombe_x = 0, bombe_y = 0;
int score = 0, highscore1 = 0, highscore2 = 0, scoreBattu = 0, combo = 0;
int tmp = 0, temps = 0, tmp2 = 0, animPerdu = 0;
int val_return = 1;
int multiplier = 1, tempsMultiplier = 0;
int bombes_coupee = 0, etoiles_coupee = 0;
int speed = SPEED;
struct Cuts cuts[NB_CUTS];
TL_Point p1, p2;
Fruit fruits[NB_FRUITS_AFFICHES];
Animation animations[NB_ANIM];
Combo combos = {0, 0};
unsigned char *objets[NB_FRUITS][8];
int achievements[NB_ACHIEVEMENTS];
unsigned int fps = 0, fps_count = 0, fps_time = 0; // compteur de FPS
/***** Initialisation *****/
couleur = chargerCouleur();
chargerHighscore(&highscore1, &highscore2);
chargerAchievements(achievements);
if(chargerTemps(&temps) <=0)
{
sauverTemps(temps);
if(chargerTemps(&temps) <=0) error();
}
tmp = RTC_getTicks();
p1.x = -1;
p2.x = -1;
p1.y = -1;
p2.y = -1;
/* --- On affecte à chaque case du tableau un pointeur vers le sprite correspondant --- */
objets[PASTEQUE][0] = past1;
objets[PASTEQUE][1] = past2;
objets[PASTEQUE][2] = past3;
objets[PASTEQUE][3] = past4;
objets[PASTEQUE][4] = past5;
objets[PASTEQUE][5] = past6;
objets[PASTEQUE][6] = past7;
objets[PASTEQUE][7] = past8;
objets[FRAISE][0] = fraise1;
objets[FRAISE][1] = fraise2;
objets[FRAISE][2] = fraise3;
objets[FRAISE][3] = fraise4;
objets[FRAISE][4] = fraise5;
objets[FRAISE][5] = fraise6;
objets[FRAISE][6] = fraise7;
objets[FRAISE][7] = fraise8;
objets[BOMBE][0] = bombe1;
objets[BOMBE][1] = bombe2;
objets[BOMBE][2] = bombe3;
objets[BOMBE][3] = bombe4;
objets[BOMBE][4] = bombe5;
objets[BOMBE][5] = bombe6;
objets[BOMBE][6] = bombe7;
objets[BOMBE][7] = bombe8;
objets[ORANGE][0] = orange1;
objets[ORANGE][1] = orange2;
objets[ORANGE][2] = orange3;
objets[ORANGE][3] = orange4;
objets[ORANGE][4] = orange5;
objets[ORANGE][5] = orange6;
objets[ORANGE][6] = orange7;
objets[ORANGE][7] = orange8;
objets[ANANAS][0] = ananas1;
objets[ANANAS][1] = ananas2;
objets[ANANAS][2] = ananas3;
objets[ANANAS][3] = ananas4;
objets[ANANAS][4] = ananas5;
objets[ANANAS][5] = ananas6;
objets[ANANAS][6] = ananas7;
objets[ANANAS][7] = ananas8;
objets[ETOILE][0] = etoile1;
objets[ETOILE][1] = etoile2;
objets[ETOILE][2] = etoile3;
objets[ETOILE][3] = etoile4;
objets[ETOILE][4] = etoile1;
objets[ETOILE][5] = etoile2;
objets[ETOILE][6] = etoile3;
objets[ETOILE][7] = etoile4;
/* --- On initialise les cuts et les fruits --- */
for(i=0; i<NB_CUTS; i++)
{
cuts[i].tempsAfficher = 0;
cuts[i].initialisation = EN_ATTENTE;
}
for(i=0; i<NB_ANIM; i++)
{
animations[i].mode = EN_ATTENTE;
animations[i].type = 0;
animations[i].temps = 0;
}
for(i=0; i<NB_FRUITS_AFFICHES; i++)
{
fruits[i].objet = BOMBE;
fruits[i].idImage = 0;
fruits[i].idImage = 0;
fruits[i].afficher = EN_ATTENTE;
fruits[i].x = 50;
fruits[i].y = 100;
fruits[i].fHor = 0;
fruits[i].fVer = 0;
fruits[i].fHor1 = 0;
fruits[i].fVer1 = 0;
fruits[i].fHor2 = 0;
fruits[i].fVer2 = 0;
}
if(type == MENU)
{
fruits[0].afficher = LANCEE;
fruits[0].idImage = 0;
fruits[0].couper = 0;
fruits[0].objet = PASTEQUE;
fruits[0].x = 10;
fruits[0].y = 38;
fruits[0].fHor = 0.0;
fruits[0].fVer = 0.0;
fruits[0].fHor2 = 0;
fruits[0].fVer2 = 0;
}
difficulte = (type==JEU) ? 0 : 1;
if(temps > 3600 && achievements[ADDICT] == 0)
{
achievements[ADDICT] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
if(temps > 36000 && achievements[NOLIFE] == 0)
{
achievements[NOLIFE] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
/***** ! BOUCLE PRINCIPALE ! *****/
while(1)
{
time++; // frame
ML_clear_vram();
if(tempsMultiplier) tempsMultiplier--;
if(multiplier == 2 && tempsMultiplier == 0) multiplier = 1;
/** /!\ DEBUG /!\ **/
/*
if(IsKeyDown(KEY_CTRL_F4)) fruits[0].objet --;
if(fruits[0].objet < 0) fruits[0].objet = NB_FRUITS-1; /**/
/** FIN DEBUG **/
if(type == MENU)
{
if(IsKeyDown(KEY_CTRL_F6)) return 4;
if(IsKeyDown(KEY_CTRL_F1)) return 0;
if(IsKeyDown(KEY_CTRL_F2)) val_return = 1;
if(IsKeyDown(KEY_CTRL_F3)) val_return = 2;
if(IsKeyDown(KEY_CTRL_F4)) val_return = 3;
}
if(type != MENU)
{
if(IsKeyDown(KEY_CTRL_F1)) break;
if(IsKeyDown(KEY_CTRL_F6))
{
more();
couleur = chargerCouleur();
}
}
// changement des tiles des fruits
if(time%2 == 0)
{
for(i=0; i<5; i++)
{
if(!fruits[i].couper)
{
fruits[i].idImage++;
if(fruits[i].idImage > 7) fruits[i].idImage = 0;
}
}
}
/***** FONCTIONS DE GAMING *****/
if(type == ARCADE && time == 1920)
{
k = anim_Arcade(couleur);
if(k>50 && !achievements[P50GSFRUIT]) achievements[P50GSFRUIT] = 1;
score += k;
Sleep(300);
break;
}
if(type == JEU || type == JEU_LIBRE || (type == ARCADE && time < 1820))
{
if(time%100 == 0) // on lance un bonus
{
if(randInt_a_b(0, 3) == 1)
{
for(i=0; i<NB_FRUITS_AFFICHES; i++)
{
if(fruits[i].afficher == EN_ATTENTE)
{
fruits[i].x = randInt_a_b(130, 135);
fruits[i].y = randInt_a_b(30, 50);
fruits[i].fHor = randFloat_a_b(-1.5, -0.9);
fruits[i].fVer = randFloat_a_b(1.0, 1.5);
fruits[i].idImage = randInt_a_b(0, 6);
fruits[i].couper = 0;
fruits[i].objet = randInt_a_b(5, 6);
fruits[i].afficher = LANCEE;
fruits[i].mouvement = MONTER;
break;
}
}
}
}
if((type==ARCADE || type==JEU) && time%20 == 0 && randInt_a_b(0,2*(3+type))==0) // on lance de nouvelles bombes
{
for(i=0; i<NB_FRUITS_AFFICHES; i++)
{
if(fruits[i].afficher == EN_ATTENTE)
{
fruits[i].x = randInt_a_b(10, 90);
fruits[i].y = 75;
fruits[i].fHor = randFloat_a_b(-0.3, 0.3);
fruits[i].fVer = randFloat_a_b(1.90, 2.0);
fruits[i].idImage = randInt_a_b(0, 5);
fruits[i].couper = 0;
fruits[i].objet = randInt_a_b(0, 1);
fruits[i].afficher = LANCEE;
fruits[i].mouvement = MONTER;
break;
}
}
}
if(time%10 == 0) // on lance de nouveaux fruits
{
for(i=0; i<NB_FRUITS_AFFICHES; i++)
{
if(fruits[i].afficher == EN_ATTENTE)
{
fruits[i].x = randInt_a_b(10, 90);
fruits[i].y = 75;
fruits[i].fHor = randFloat_a_b(-0.3, 0.3);
fruits[i].fVer = randFloat_a_b(1.90, 2.0);
fruits[i].idImage = randInt_a_b(0, 5);
fruits[i].couper = 0;
fruits[i].objet = randInt_a_b(1, 5);
fruits[i].afficher = LANCEE;
fruits[i].mouvement = MONTER;
break;
}
}
}
if(combos.temps == 0)
{
switch(combos.nb)
{
case 3:
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = BONUS_3;
animations[i].temps = 50;
break;
}
}
score += 3 * multiplier;
if(!achievements[C3])
{
achievements[C3] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
break;
case 4:
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = BONUS_4;
animations[i].temps = 50;
break;
}
}
score += 5 * multiplier;
break;
}
if(combos.nb >= 5)
{
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = BONUS_5;
animations[i].temps = 50;
break;
}
}
score += 10 * multiplier;
if(!achievements[C5])
{
achievements[C5] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
}
combos.nb = 0; // on reinitialise le compteur
}
if(combos.temps>0) combos.temps--;
}
/***** FONCTIONS TACTILES *****/
TL_getTouchXY(&p1);
if(p1.x<0) Sleep(0.1);
if(p2.x > -1 && p1.x > -1)
{
for(i=0; i<NB_CUTS; i++)
{
if(cuts[i].initialisation == EN_ATTENTE)
{
cuts[i].initialisation = LANCEE;
cuts[i].tempsAfficher = 10;
cuts[i].p1.x = p1.x;
cuts[i].p1.y = p1.y;
cuts[i].p2.x = p2.x;
cuts[i].p2.y = p2.y;
break;
}
}
}
else Sleep(1);
if(time%3 == 0 || (p1.x != p2.x && p1.y != p2.y && p1.x>-1)) { p2.x = p1.x; p2.y = p1.y; }
for(i=0; i<NB_CUTS; i++)
{
if(cuts[i].initialisation == LANCEE) cuts[i].tempsAfficher--;
if(cuts[i].tempsAfficher < 1) cuts[i].initialisation = EN_ATTENTE;
}
/***** FONCTIONS DE COLLISION *****/
for(i=0; i<NB_CUTS; i++)
{
if(cuts[i].tempsAfficher == 8 || cuts[i].tempsAfficher == 9)
{
for(j=0; j<NB_FRUITS_AFFICHES; j++)
{
if(fruits[j].afficher == LANCEE && fruits[j].couper == 0)
{
int a, b, c, d;
TL_Point A, B, C, D, C1, C2;
a = 0;
b = 0;
c = 0;
d = 0;
A.x = fruits[j].x; A.y = fruits[j].y;
B.x = fruits[j].x + 16; B.y = fruits[j].y;
C.x = fruits[j].x + 16; C.y = fruits[j].y + 16;
D.x = fruits[j].x; D.y = fruits[j].y + 16;
C1.x = 6.4*cuts[i].p1.x; C1.y = 3.2*cuts[i].p1.y;
C2.x = 6.4*cuts[i].p2.x; C2.y = 3.2*cuts[i].p2.y;
a = CollisionSegSeg(C1, C2, A, B);
b = CollisionSegSeg(C1, C2, B, C);
c = CollisionSegSeg(C1, C2, C, D);
d = CollisionSegSeg(C1, C2, A, D);
if(a || b || c || d)
{
if(fruits[j].objet == BOMBE)
{
if(type==JEU)
{
perdu = 1;
bombe_x = fruits[j].x;
bombe_y = fruits[j].y;
}
else if(type==ARCADE)
{
animPerdu = j;
score -= 10;
++bombes_coupee;
}
}
else if(fruits[j].objet == ETOILE)
{
++etoiles_coupee;
tempsMultiplier = TEMPS_MULTIPLIER;
multiplier = 2;
for(k=0; k<NB_ANIM; k++)
{
if(animations[k].mode == EN_ATTENTE)
{
animations[k].mode = LANCEE;
animations[k].type = MULTIPLIER;
animations[k].temps = TEMPS_MULTIPLIER;
break;
}
}
fruits[j].couper = 1;
fruits[j].bout1x = fruits[j].x;
fruits[j].bout1y = fruits[j].y;
fruits[j].bout2x = fruits[j].x;
fruits[j].bout2y = fruits[j].y + 8;
fruits[j].fHor1 = randFloat_a_b(-0.7, 0.7) + fruits[j].fHor;
fruits[j].fHor2 = randFloat_a_b(-0.7, 0.7) + fruits[j].fHor;
fruits[j].fVer1 = randFloat_a_b(0.6, 1.1) + fruits[j].fVer;
fruits[j].fVer2 = randFloat_a_b(0.3, 1.0) + fruits[j].fVer;
score += 5;
combos.temps = 3;
}
else
{
fruits[j].couper = 1;
fruits[j].bout1x = fruits[j].x;
fruits[j].bout1y = fruits[j].y;
fruits[j].bout2x = fruits[j].x;
fruits[j].bout2y = fruits[j].y + 8;
fruits[j].fHor1 = randFloat_a_b(-0.7, 0.7) + fruits[j].fHor;
fruits[j].fHor2 = randFloat_a_b(-0.7, 0.7) + fruits[j].fHor;
fruits[j].fVer1 = randFloat_a_b(0.6, 1.1) + fruits[j].fVer;
fruits[j].fVer2 = randFloat_a_b(0.3, 1.0) + fruits[j].fVer;
score += multiplier;
combos.temps = 3;
combos.nb++;
}
}
}
}
}
}
/***** FONCTIONS SUR LES FRUITS *****/
if(type != MENU)
{
for(i=0; i<NB_FRUITS_AFFICHES; i++)
{
if(fruits[i].afficher == LANCEE)
{
if(fruits[i].fVer < 0) fruits[i].mouvement = DESCENDRE;
if(fruits[i].mouvement == DESCENDRE)
{
if(fruits[i].y > 65)
{
if(fruits[i].couper == 0 && fruits[i].objet != BOMBE && fruits[i].objet != ETOILE)
{
if(type == JEU) vie++;
for(j=0; j<NB_ANIM; j++)
{
if(animations[j].mode == EN_ATTENTE)
{
animations[j].mode = LANCEE;
animations[j].type = VIE_PERDUE;
animations[j].temps = 12;
break;
}
}
fruits[i].afficher = EN_ATTENTE;
}
else if(fruits[i].bout1y > 65) fruits[i].afficher = EN_ATTENTE;
if(fruits[i].objet == BOMBE || fruits[i].objet == ETOILE) fruits[i].afficher = EN_ATTENTE;
}
}
/***** fonctions physique *****/
fruits[i].fVer -= GRAVITE;
fruits[i].y -= fruits[i].fVer;
fruits[i].x += fruits[i].fHor;
if(fruits[i].couper == 1)
{
fruits[i].fVer1 -= GRAVITE;
fruits[i].bout1y -= fruits[i].fVer1;
fruits[i].bout1x += fruits[i].fHor1;
fruits[i].fVer2 -= GRAVITE;
fruits[i].bout2y -= fruits[i].fVer2;
fruits[i].bout2x += fruits[i].fHor2;
}
}
}
}
// DANS LE CAS DU MENU
if(type == MENU)
{
if(fruits[0].couper == 1)
{
fruits[0].fVer1 -= GRAVITE;
fruits[0].bout1y -= fruits[0].fVer1;
fruits[0].bout1x += fruits[0].fHor1;
fruits[0].fVer2 -= GRAVITE;
fruits[0].bout2y -= fruits[0].fVer2;
fruits[0].bout2x += fruits[0].fHor2;
if(fruits[0].bout1y > 64) return val_return;
}
}
/***** FONCTIONS ACHEVEMENTS ET SCORE *****/
if(type == JEU || type==ARCADE)
{
if(!scoreBattu) // si le score n'est pas battu
{
if((type==JEU && score > highscore1) || (type==ARCADE && score > highscore2))
{
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = HIGHSCORE;
animations[i].temps = 80;
break;
}
}
scoreBattu = 1;
}
}
if(score >= 100 && type==JEU)
{
if(achievements[P100] == 0)
{
achievements[P100] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
}
if(score >= 50 && type==JEU)
{
if(achievements[P50] == 0)
{
achievements[P50] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
}
if(score >= 100 && type==ARCADE)
{
if(achievements[P100ARC] == 0)
{
achievements[P100ARC] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
}
if(score >= 50 && type==ARCADE)
{
if(achievements[P50ARC] == 0)
{
achievements[P50ARC] = 1;
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == EN_ATTENTE)
{
animations[i].mode = LANCEE;
animations[i].type = ACHIEVEMENT;
animations[i].temps = 80;
break;
}
}
}
}
}
/***** FONCTIONS D'AFFICHAGE *****/
if(type == MENU)
{
ML_bmp_or(bgaccueil, 0, 0, 128, 64);
switch(val_return)
{
case 1: ML_bmp_or(cut2play, 35, 37, 93, 27);
break;
case 2: ML_bmp_or(arcade, 35, 37, 93, 27);
break;
case 3: ML_bmp_or(peacefull, 35, 37, 93, 27);
break;
}
}
if(type != MENU) ML_bmp_or(bgjeu, 0, 0, 128, 64);
// affichage des fruit
for(i=0; i<NB_FRUITS_AFFICHES; i++)
{
if(fruits[i].afficher == LANCEE)
{
if(fruits[i].couper == 0)
{
ML_bmp_16_or_cl(objets[fruits[i].objet][fruits[i].idImage], fruits[i].x, fruits[i].y);
}
else
{
ML_bmp_or_cl(objets[fruits[i].objet][fruits[i].idImage], fruits[i].bout1x, fruits[i].bout1y, 16, 8);
ML_bmp_or_cl(objets[fruits[i].objet][fruits[i].idImage] + 16, fruits[i].bout2x, fruits[i].bout2y, 16, 8);
}
}
}
for(i=0; i<NB_CUTS; i++) // On affiche les cuts à l'écran en fonction de leur vieillesse
{
if(cuts[i].tempsAfficher)
{
if(cuts[i].tempsAfficher < 8)
{
ML_line(6.4*cuts[i].p1.x + 1, 3.2*cuts[i].p1.y, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
}
else
{
ML_line(6.4*cuts[i].p1.x + 1, 3.2*cuts[i].p1.y, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
ML_line(6.4*cuts[i].p1.x - 1, 3.2*cuts[i].p1.y, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
ML_line(6.4*cuts[i].p1.x, 3.2*cuts[i].p1.y + 1, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
ML_line(6.4*cuts[i].p1.x, 3.2*cuts[i].p1.y - 1, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
}
}
}
if(type != MENU)
{
for(i=0; i<vie; i++) ML_bmp_or(Svie, 102 + 9*i, 2, 5, 5);
/***** FONCTIONS D'ANIMATION *****/
for(i=0; i<NB_ANIM; i++)
{
if(animations[i].mode == LANCEE)
{
// code à insérer en fonction de chaque anim
switch(animations[i].type)
{
case VIE_PERDUE:
switch(animations[i].temps%4 == 0)
{
case 0: ML_horizontal_scroll(3);
case 1: ML_vertical_scroll(3);
case 2: ML_horizontal_scroll(-3);
case 3: ML_vertical_scroll(-3);
}
break;
case BONUS_3:
if(animations[i].temps > 24) ML_bmp_16_or_cl(bonus3, 57 , 8);
else ML_bmp_16_or_cl(bonus3, 57, animations[i].temps - 16);
break;
case BONUS_4:
if(animations[i].temps > 24) ML_bmp_16_or_cl(bonus4, 57 , 8);
else ML_bmp_16_or_cl(bonus4, 57, animations[i].temps - 16);
break;
case BONUS_5:
if(animations[i].temps > 24) ML_bmp_16_or_cl(bonus5, 57 , 8);
else ML_bmp_16_or_cl(bonus5, 57, animations[i].temps - 16);
break;
case ACHIEVEMENT:
if(animations[i].temps > 60) ML_bmp_or_cl(newa, 60 - animations[i].temps , i*16+10, 20, 16);
else if(animations[i].temps > 20) ML_bmp_or_cl(newa, 0, i*16+10, 20, 16);
else ML_bmp_or_cl(newa, animations[i].temps - 20, i*16+10, 20, 16);
break;
case HIGHSCORE:
if(animations[i].temps > 60) ML_bmp_or_cl(newhs, 60 - animations[i].temps , i*16+10, 20, 16);
else if(animations[i].temps > 20) ML_bmp_or_cl(newhs, 0, i*16+10, 20, 16);
else ML_bmp_or_cl(newhs, animations[i].temps - 20, i*16+10, 20, 16);
break;
case MULTIPLIER:
if(animations[i].temps > TEMPS_MULTIPLIER - 20) ML_bmp_or_cl(foisdeux, TEMPS_MULTIPLIER - 20 - animations[i].temps , i*16+10, 20, 16);
else if(animations[i].temps > 20) ML_bmp_or_cl(foisdeux, 0, i*16+10, 20, 16);
else ML_bmp_or_cl(foisdeux, animations[i].temps - 20, i*16+10, 20, 16);
break;
}
animations[i].temps--;
if(animations[i].temps == 0) animations[i].mode = EN_ATTENTE;
}
}
}
if(vie > 3) break;
/***** FPS *****//*
if( RTC_getTicks() - fps_time >= 128) // si le temps écoulé est supérieur ou égal à 128 ticks (1 seconde)
{
fps = fps_count; // on mémorise le nombre de frame qu'il y a eu pendant la seconde qui vient de s'écouler
fps_count = 1; // on ré-initialise le compteur
fps_time = RTC_getTicks(); // on sauvegarde le temps du début de la seconde actuelle
} else fps_count++; //une image de plus
/**/
// affichage du score et de la vie
if(type != MENU) printVmini(1, 1, score);
if(type == ARCADE) printVmini(60, 1, (1920 - time)/32);
if(couleur == INVERSE) ML_rectangle(0, 0, 128, 64, 0, ML_XOR, ML_XOR);
ML_display_vram();
if(perdu == 1)
{
anim_perdu(bombe_x, bombe_y, couleur);
break;
}
if(animPerdu)
{
anim_perdu(fruits[animPerdu].x, fruits[animPerdu].y, couleur);
ML_rectangle(0,0,128,64,1,ML_BLACK,ML_BLACK);
ML_display_vram();
Sleep(50);
ML_clear_vram();
ML_display_vram();
Sleep(50);
animPerdu = 0;
for(k=0; k<NB_FRUITS_AFFICHES; ++k)
{
fruits[k].afficher = EN_ATTENTE;
}
}
setFps(4);
Sleep(5);
}
ML_clear_vram();
ML_bmp_or(bggameover, 0, 0, 128, 64);
printV(61, 32, score);
if(type==ARCADE) printV(87, 45, highscore2);
else printV(87, 45, highscore1);
if(couleur == INVERSE) ML_rectangle(0, 0, 128, 64, 0, ML_XOR, ML_XOR);
ML_display_vram();
Sleep(800);
while(i!=KEY_CTRL_EXE)
{
GetKey(&i);
}
if(time > 32*30 && !achievements[P30S]) achievements[P30S] = 1;
if(time > 32*60 && !achievements[P30S]) achievements[P60S] = 1;
if(time > 32*180 && !achievements[P30S]) achievements[P180S] = 1;
if(scoreBattu)
{
if(type==JEU) highscore1 = score;
if(type==ARCADE) highscore2 = score;
initialiserHighscore(highscore1, highscore2);
}
if(bombes_coupee == 0 && !achievements[NOBOMBS]) achievements[NOBOMBS] = 1;
if(etoiles_coupee >= 5 && achievements[SUPERSTAR]==0) achievements[SUPERSTAR] = 1;
initialiserAchievements(achievements);
if(chargerTemps(&temps) <=0)
{
sauverTemps(temps);
if(chargerTemps(&temps) <=0) error();
}
tmp2 = RTC_getTicks();
temps += (tmp2 - tmp)/128;
sauverTemps(temps);
}
/***** PERDU ET AUTRES *****/
void anim_perdu(int bombe_x, int bombe_y, int couleur)
{
int i = 0;
int abscisses[4];
int ordonnees[4];
int couleur2;
abscisses[0] = bombe_x + 8;
ordonnees[0] = bombe_y + 8;
couleur2 = (couleur == NORMAL) ? ML_BLACK : ML_WHITE;
/* premier trait */
abscisses[1] = randInt_a_b(73, 80);
ordonnees[1] = 0;
abscisses[2] = randInt_a_b(83, 89);
ordonnees[2] = 0;
ML_filled_polygon(abscisses, ordonnees, 3, couleur2);
for(i=0; i<12; i++)
{
switch(i%4)
{
case 0: ML_horizontal_scroll(1);
break;
case 1: ML_vertical_scroll(-1);
break;
case 2: ML_horizontal_scroll(-1);
break;
case 3: ML_vertical_scroll(1);
break;
}
ML_display_vram();
Sleep(VIT_ANIM_PERDU);
}
/* deuxieme trait */
abscisses[1] = randInt_a_b(36, 44);
ordonnees[1] = 63;
abscisses[2] = randInt_a_b(53, 61);
ordonnees[2] = 63;
ML_filled_polygon(abscisses, ordonnees, 3, couleur2);
for(i=0; i<12; i++)
{
switch(i%4)
{
case 0: ML_horizontal_scroll(1);
break;
case 1: ML_vertical_scroll(-1);
break;
case 2: ML_horizontal_scroll(-1);
break;
case 3: ML_vertical_scroll(1);
break;
}
ML_display_vram();
Sleep(VIT_ANIM_PERDU);
}
/* troisieme trait */
abscisses[1] = 0;
ordonnees[1] = randInt_a_b(26, 32);
abscisses[2] = 0;
ordonnees[2] = randInt_a_b(35, 40);
ML_filled_polygon(abscisses, ordonnees, 3, couleur2);
for(i=0; i<12; i++)
{
switch(i%4)
{
case 0: ML_horizontal_scroll(1);
break;
case 1: ML_vertical_scroll(-1);
break;
case 2: ML_horizontal_scroll(-1);
break;
case 3: ML_vertical_scroll(1);
break;
}
ML_display_vram();
Sleep(VIT_ANIM_PERDU);
}
/* quatrieme trait */
abscisses[1] = 127;
ordonnees[1] = randInt_a_b(0, 5);
abscisses[2] = 127;
ordonnees[2] = 0;
abscisses[3] = randInt_a_b(116, 122);
ordonnees[3] = 0;
ML_filled_polygon(abscisses, ordonnees, 4, couleur2);
for(i=0; i<12; i++)
{
switch(i%4)
{
case 0: ML_horizontal_scroll(1);
break;
case 1: ML_vertical_scroll(-1);
break;
case 2: ML_horizontal_scroll(-1);
break;
case 3: ML_vertical_scroll(1);
break;
}
ML_display_vram();
Sleep(VIT_ANIM_PERDU);
}
/* cinquieme trait */
abscisses[1] = randInt_a_b(91, 97);
ordonnees[1] = 63;
abscisses[2] = randInt_a_b(100, 105);
ordonnees[2] = 63;
ML_filled_polygon(abscisses, ordonnees, 3, couleur2);
for(i=0; i<12; i++)
{
switch(i%4)
{
case 0: ML_horizontal_scroll(1);
break;
case 1: ML_vertical_scroll(-1);
break;
case 2: ML_horizontal_scroll(-1);
break;
case 3: ML_vertical_scroll(1);
break;
}
ML_display_vram();
Sleep(30);
}
/* sixieme trait */
abscisses[1] = 0;
ordonnees[1] = randInt_a_b(2, 8);
abscisses[2] = 0;
ordonnees[2] = 0;
abscisses[3] = randInt_a_b(4, 12);
ordonnees[3] = 0;
ML_filled_polygon(abscisses, ordonnees, 4, couleur2);
for(i=0; i<12; i++)
{
switch(i%4)
{
case 0: ML_horizontal_scroll(1);
break;
case 1: ML_vertical_scroll(-1);
break;
case 2: ML_horizontal_scroll(-1);
break;
case 3: ML_vertical_scroll(1);
break;
}
ML_display_vram();
Sleep(VIT_ANIM_PERDU);
}
/* septieme trait */
abscisses[1] = 127;
ordonnees[1] = randInt_a_b(37, 41);
abscisses[2] = 127;
ordonnees[2] = randInt_a_b(44, 49);
ML_filled_polygon(abscisses, ordonnees, 3, couleur2);
for(i=0; i<12; i++)
{
switch(i%4)
{
case 0: ML_horizontal_scroll(1);
break;
case 1: ML_vertical_scroll(-1);
break;
case 2: ML_horizontal_scroll(-1);
break;
case 3: ML_vertical_scroll(1);
break;
}
ML_display_vram();
Sleep(VIT_ANIM_PERDU);
}
}
int anim_Arcade(int couleur)
{
const unsigned char Svie[] = {0x88, 0x50, 0x20, 0x50, 0x88};
const unsigned char bigFruit4[]={0x0,0x3f,0xf0,0x0,0x0,0xff,0xfe,0x0,0x3,0xc8,0xf,0x0,0x7,0x2,0x3,0x80,0xe,0x20,0x21,0xc0,0x18,0x80,0x80,0xe0,0x3c,0x4,0x4,0x70,0x30,0x10,0x10,0x38,0x61,0x1,0x1,0x18,0x60,0x40,0x40,0x58,0xc8,0x8,0x8,0xc,0xc2,0x2,0x2,0xc,0xe0,0x20,0x20,0x2c,0xc0,0x80,0x80,0x8c,0xc4,0x4,0x4,0xc,0xd0,0x10,0x10,0x1c,0xc1,0x1,0x1,0xc,0xc0,0xc0,0x40,0x4c,0xc8,0xc8,0x8,0xc,0xc2,0x62,0x2,0xc,0x60,0x30,0x20,0x38,0x60,0x9c,0x80,0x98,0x34,0x6,0x4,0x30,0x38,0x10,0x10,0x70,0x1d,0x1,0x1,0x60,0xe,0x40,0x41,0xc0,0x7,0x8,0xb,0x80,0x3,0xc2,0xf,0x0,0x0,0xff,0xfc,0x0,0x0,0x3f,0xf0,0x0};
const unsigned char bigFruit1[]={0x0,0x3f,0xf0,0x0,0x0,0xff,0xfc,0x0,0x3,0xc0,0x4f,0x0,0x7,0x2,0x3,0x80,0xe,0x10,0x11,0xc0,0x1d,0x1,0x1,0x60,0x38,0x20,0x20,0x70,0x34,0x4,0x4,0x30,0x60,0x98,0x80,0x98,0x68,0x38,0x8,0x18,0xc0,0x60,0x40,0x4c,0xc2,0xc2,0x2,0xc,0xd0,0x90,0x10,0x1c,0xc1,0x81,0x1,0xc,0xe1,0x20,0x20,0x2c,0xc4,0x4,0x4,0xc,0xc0,0x80,0x80,0x8c,0xc8,0x8,0x8,0xc,0xc0,0x40,0x40,0x4c,0xc2,0x2,0x2,0xc,0x70,0x10,0x10,0x18,0x61,0x1,0x1,0x18,0x30,0x20,0x20,0x38,0x3c,0x4,0x4,0x70,0x18,0x80,0x80,0xe0,0xe,0x8,0x9,0xc0,0x7,0x40,0x43,0x80,0x3,0xc2,0xf,0x0,0x0,0xff,0xfe,0x0,0x0,0x3f,0xf0,0x0};
const unsigned char bigFruit2[]={0x0,0x3f,0xf0,0x0,0x0,0xff,0xfc,0x0,0x3,0xc1,0xf,0x0,0x7,0x40,0x43,0x80,0xe,0x8,0x9,0xc0,0x1a,0x2,0x2,0xe0,0x38,0x20,0x20,0x70,0x30,0x81,0x80,0xb0,0x64,0x4,0xe4,0x18,0x70,0x10,0x30,0x18,0xc1,0x1,0x19,0xc,0xc0,0x40,0x4c,0x4c,0xc8,0x8,0xc,0xc,0xc2,0x2,0x2,0xc,0xe0,0x20,0x20,0x2c,0xc0,0x80,0x80,0x8c,0xc4,0x4,0x4,0xc,0xd0,0x10,0x10,0x1c,0xc1,0x1,0x1,0xc,0xc0,0x40,0x40,0x4c,0x68,0x8,0x8,0x18,0x62,0x2,0x2,0x18,0x70,0x20,0x20,0x30,0x38,0x80,0x80,0xf0,0x1c,0x4,0x4,0x60,0xe,0x10,0x11,0xc0,0x7,0x1,0x3,0x80,0x3,0xc0,0x4f,0x0,0x1,0xff,0xfc,0x0,0x0,0x3f,0xf0,0x0};
const unsigned char bigFruit3[]={0x0,0x3f,0xf0,0x0,0x1,0xff,0xfc,0x0,0x3,0xc1,0xf,0x0,0x7,0x8,0xb,0x80,0xe,0x40,0x41,0xc0,0x1c,0x4,0x4,0x60,0x38,0x80,0x80,0xf0,0x70,0x10,0x10,0x30,0x62,0x2,0x2,0x18,0x60,0x20,0x20,0x38,0xc1,0x1,0x1,0xc,0xc8,0x8,0x8,0xc,0xc0,0x40,0x40,0x4c,0xc4,0x4,0x4,0xc,0xc0,0x80,0x80,0x8c,0xd0,0x10,0x12,0x1c,0xc2,0x2,0x6,0xc,0xe0,0x20,0x24,0x2c,0xc1,0x1,0xd,0xc,0xc8,0x8,0x18,0xc,0x60,0x40,0x70,0x58,0x64,0x4,0x64,0x18,0x30,0x80,0x80,0xb0,0x38,0x10,0x10,0x70,0x1a,0x2,0x2,0xe0,0xe,0x20,0x21,0xc0,0x7,0x1,0x3,0x80,0x3,0xc8,0xf,0x0,0x0,0xff,0xfc,0x0,0x0,0x3f,0xf0,0x0};
const unsigned char bgjeu[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x21, 0x10, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x52, 0xA9, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xA1, 0x50, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0xA0, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xA1, 0x50, 0xA8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, 0x52, 0xA9, 0x54, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x21, 0x10, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
struct Cuts cuts[NB_CUTS];
Fruit bigFruit;
TL_Point p1 = {-1, -1}, p2 = {-1, -1};
int speed = SPEED / 3;
int time = 0, tremblements = 0;
int coups = 0;
int i;
unsigned char *objet[8];
/* INITIALISATION */
objet[0] = bigFruit1;
objet[1] = bigFruit2;
objet[2] = bigFruit3;
objet[3] = bigFruit4;
objet[4] = bigFruit1;
objet[5] = bigFruit2;
objet[6] = bigFruit3;
objet[7] = bigFruit4;
bigFruit.objet = 0;
bigFruit.idImage = 0;
bigFruit.afficher = LANCEE;
bigFruit.couper = 0;
bigFruit.mouvement = MONTER;
bigFruit.x = randInt_a_b(40, 55);
bigFruit.y = 70;
bigFruit.fHor = randFloat_a_b(-0.2, 0.2);
bigFruit.fVer = 2.5;
bigFruit.fHor1 = 0;
bigFruit.fVer1 = 0;
bigFruit.fHor2 = 0;
bigFruit.fVer2 = 0;
for(i=0; i<NB_CUTS; i++)
{
cuts[i].tempsAfficher = 0;
cuts[i].initialisation = EN_ATTENTE;
}
while(1)
{
time++;
if(IsKeyDown(KEY_CTRL_F1)) break;
if(IsKeyDown(KEY_CTRL_F6))
{
more();
couleur = chargerCouleur();
}
// changement des tiles du bigFruit
if(time%4 == 0)
{
if(!bigFruit.couper)
{
bigFruit.idImage++;
if(bigFruit.idImage > 7) bigFruit.idImage = 0;
}
}
if(tremblements) --tremblements;
/* FONCTIONS TACTILES */
TL_getTouchXY(&p1);
if(p1.x<0) Sleep(0.1);
if(p2.x > -1 && p1.x > -1)
{
for(i=0; i<NB_CUTS; i++)
{
if(cuts[i].initialisation == EN_ATTENTE)
{
cuts[i].initialisation = LANCEE;
cuts[i].tempsAfficher = 10;
cuts[i].p1.x = p1.x;
cuts[i].p1.y = p1.y;
cuts[i].p2.x = p2.x;
cuts[i].p2.y = p2.y;
break;
}
}
}
else Sleep(1);
if(time%3 == 0 || (p1.x != p2.x && p1.y != p2.y && p1.x>-1)) { p2.x = p1.x; p2.y = p1.y; }
for(i=0; i<NB_CUTS; i++)
{
if(cuts[i].initialisation == LANCEE) cuts[i].tempsAfficher--;
if(cuts[i].tempsAfficher < 1) cuts[i].initialisation = EN_ATTENTE;
}
/***** FONCTIONS DE COLLISION *****/
for(i=0; i<NB_CUTS; i++)
{
if(cuts[i].tempsAfficher == 9)
{
int a, b, c, d;
TL_Point A, B, C, D, C1, C2;
a = 0;
b = 0;
c = 0;
d = 0;
A.x = bigFruit.x; A.y = bigFruit.y;
B.x = bigFruit.x + 30; B.y = bigFruit.y;
C.x = bigFruit.x + 30; C.y = bigFruit.y + 30;
D.x = bigFruit.x; D.y = bigFruit.y + 30;
C1.x = 6.4*cuts[i].p1.x; C1.y = 3.2*cuts[i].p1.y;
C2.x = 6.4*cuts[i].p2.x; C2.y = 3.2*cuts[i].p2.y;
a = CollisionSegSeg(C1, C2, A, B);
b = CollisionSegSeg(C1, C2, B, C);
c = CollisionSegSeg(C1, C2, C, D);
d = CollisionSegSeg(C1, C2, A, D);
if(a || b || c || d)
{
if(!bigFruit.couper)
{
bigFruit.couper = 1;
bigFruit.fVer *= 0.1;
bigFruit.fHor *= 0.3;
}
++coups;
tremblements = 10;
}
}
}
/**** FONCTION SUR LE BIGFRUIT *****/
if(bigFruit.fVer < 0) bigFruit.mouvement = DESCENDRE;
if(bigFruit.mouvement == DESCENDRE)
{
if(bigFruit.y > 65)
{
break;
}
}
/***** ARRET DE LA BOUCLE *****/
if(bigFruit.couper && time > 225)
{
explosionBigFruit(bigFruit.x, bigFruit.y, couleur);
break;
}
/***** FONCTIONS PHYSIQUE *****/
if(bigFruit.couper == 1) bigFruit.fVer -= 0.005;
else bigFruit.fVer -= GRAVITE/2;
bigFruit.y -= bigFruit.fVer;
bigFruit.x += bigFruit.fHor;
/***** FONCTIONS D'AFFICHAGE *****/
ML_clear_vram();
ML_bmp_or_cl(objet[bigFruit.idImage], bigFruit.x, bigFruit.y, 30, 30);
ML_bmp_or(bgjeu, 0, 0, 128, 64);
for(i=0; i<NB_CUTS; i++) // On affiche les cuts à l'écran en fonction de leur vieillesse
{
if(cuts[i].tempsAfficher)
{
if(cuts[i].tempsAfficher < 8)
{
ML_line(6.4*cuts[i].p1.x + 1, 3.2*cuts[i].p1.y, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
}
else
{
ML_line(6.4*cuts[i].p1.x + 1, 3.2*cuts[i].p1.y, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
ML_line(6.4*cuts[i].p1.x - 1, 3.2*cuts[i].p1.y, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
ML_line(6.4*cuts[i].p1.x, 3.2*cuts[i].p1.y + 1, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
ML_line(6.4*cuts[i].p1.x, 3.2*cuts[i].p1.y - 1, 6.4*cuts[i].p2.x, 3.2*cuts[i].p2.y, ML_BLACK);
}
}
}
if(tremblements)
{
ML_horizontal_scroll(randInt_a_b(-3, 3));
ML_vertical_scroll(randInt_a_b(-3, 3));
}
if(couleur == INVERSE) ML_rectangle(0, 0, 128, 64, 0, ML_XOR, ML_XOR);
ML_display_vram();
Sleep(speed);
if(!bigFruit.couper) setFps(4);
}
return coups;
}
void explosionBigFruit(int x, int y, int couleur)
{
int i, j, couleur2;
struct Tache taches[8];
couleur2 = (couleur == NORMAL) ? ML_BLACK : ML_WHITE;
for(i=0; i<8; ++i)
{
taches[i].x = x+15;
taches[i].y = y+15;
taches[i].radius = randInt_a_b(3, 10);
taches[i].forceY = randInt_a_b(-15, 15);
taches[i].forceX = randInt_a_b(-30, 30);
}
for(i=0; i<35; ++i)
{
for(j=0; j<8; ++j)
{
taches[j].x += taches[j].forceX;
taches[j].y += taches[j].forceY;
taches[j].radius--;
taches[j].forceX /= 1.4;
taches[j].forceY /= 1.4;
ML_filled_circle(taches[j].x, taches[j].y, taches[j].radius, couleur2);
}
ML_display_vram();
Sleep(30);
}
ML_rectangle(0,0,128,64,1,couleur2,couleur2);
ML_display_vram();
Sleep(150);
}
/***** COLLISIONS *****/
int CollisionDroiteSeg(TL_Point A, TL_Point B, TL_Point O, TL_Point P)
{
Vecteur AO, AP, AB;
AB.x = B.x - A.x;
AB.y = B.y - A.y;
AP.x = P.x - A.x;
AP.y = P.y - A.y;
AO.x = O.x - A.x;
AO.y = O.y - A.y;
if ((AB.x*AP.y - AB.y*AP.x)*(AB.x*AO.y - AB.y*AO.x)<0)
return 1;
else
return 0;
}
int CollisionSegSeg(TL_Point A, TL_Point B, TL_Point O, TL_Point P)
{
if (CollisionDroiteSeg(A, B, O, P)==0)
return 0; // inutile d'aller plus loin si le segment [OP] ne touche pas la droite (AB)
if (CollisionDroiteSeg(O, P, A, B)==0)
return 0;
return 1;
}
/***** GESTION DES ERREURS *****/
void loading(void)
{
const unsigned char loading[] = {0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0xA1, 0x8C, 0xE7, 0x49, 0x80, 0x40, 0xA2, 0x52, 0x92, 0x6A, 0x00, 0x40, 0xA2, 0x52, 0x92, 0x5A, 0xC0, 0x40, 0xA2, 0x5E, 0x92, 0x4A, 0x40, 0x40, 0xB9, 0x92, 0xE7, 0x49, 0x95, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x80};
ML_rectangle(43, 28, 82, 35, 0, ML_WHITE, ML_WHITE);
ML_bmp_or(loading, 42, 27, 42, 9);
ML_display_vram();
}
void saved(void)
{
const unsigned char saved[] = {0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0xE6, 0x4B, 0xDC, 0x40, 0x40, 0x81, 0x09, 0x4A, 0x12, 0x40, 0x40, 0x80, 0xCF, 0x4B, 0x12, 0x40, 0x40, 0x80, 0x29, 0x52, 0x12, 0x00, 0x40, 0x81, 0xC9, 0x23, 0xDC, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x80};
ML_rectangle(43, 28, 82, 35, 0, ML_WHITE, ML_WHITE);
ML_bmp_or(saved, 42, 27, 42, 9);
ML_display_vram();
Sleep(1500);
}
void error(void)
{
const unsigned char error[] = {0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x81, 0xEE, 0x71, 0x9C, 0x40, 0x40, 0x81, 0x09, 0x4A, 0x52, 0x40, 0x40, 0x81, 0xCE, 0x72, 0x5C, 0x40, 0x40, 0x81, 0x09, 0x4A, 0x52, 0x00, 0x40, 0x81, 0xE9, 0x49, 0x92, 0x40, 0x40, 0x80, 0x00, 0x00, 0x00, 0x00, 0x40, 0x7F, 0xFF, 0xFF, 0xFF, 0xFF, 0x80};
ML_rectangle(43, 28, 82, 35, 0, ML_WHITE, ML_WHITE);
ML_bmp_or(error, 42, 27, 42, 9);
ML_display_vram();
Sleep(1500);
}
/***** ACCES AUX FICHIERS *****/
int chargerCouleur(void)
{
int couleur;
FONTCHARACTER fileName[] = { '\\', '\\', 'f', 'l', 's', '0', '\\', 'F', 'r', 'u', 'i', 't', '.', 'c', 'o', 'l', 0};
int fichier;
loading();
fichier = Bfile_OpenFile( fileName, _OPENMODE_READ);
if(fichier < 0) initialiserCouleur(NORMAL);
Bfile_ReadFile(fichier, &couleur, 8, 0 );
Bfile_CloseFile(fichier);
return couleur;
}
void initialiserCouleur(int couleur)
{
FONTCHARACTER fileName[] = { '\\', '\\', 'f', 'l', 's', '0', '\\', 'F', 'r', 'u', 'i', 't', '.', 'c', 'o', 'l', 0};
int fichier;
Bfile_DeleteFile(fileName);
loading();
Bfile_CreateFile(fileName, 8); // on creer le fichier
fichier = Bfile_OpenFile( fileName, _OPENMODE_WRITE);// on ouvre le fichier en mode ecriture : _OPENMODE_WRITE
Bfile_WriteFile(fichier, &couleur, 8); // ecriture de la couleur par defaut
Bfile_CloseFile(fichier);// on ferme le fichier
}
void chargerHighscore(int *score1, int *score2)
{
int couleur;
int buffer[2];
FONTCHARACTER fileName[] = { '\\', '\\', 'f', 'l', 's', '0', '\\', 'F', 'r', 'u', 'i', 't', '.', 's', 'c', 'o', 0};
int fichier;
loading();
fichier = Bfile_OpenFile( fileName, _OPENMODE_READ);
if(fichier < 0)
{
initialiserHighscore(0, 0);
fichier = Bfile_OpenFile( fileName, _OPENMODE_READ);
}
Bfile_ReadFile(fichier, buffer, 8, 0);
Bfile_CloseFile(fichier);
*score1 = buffer[0];
*score2 = buffer[1];
}
void initialiserHighscore(int score1, int score2)
{
FONTCHARACTER fileName[] = { '\\', '\\', 'f', 'l', 's', '0', '\\', 'F', 'r', 'u', 'i', 't', '.', 's', 'c', 'o', 0};
int fichier, buffer[2];
loading();
buffer[0] = score1;
buffer[1] = score2;
Bfile_DeleteFile(fileName);
Bfile_CreateFile(fileName, 8); // on creer le fichier
fichier = Bfile_OpenFile(fileName, _OPENMODE_WRITE);// on ouvre le fichier en mode ecriture : _OPENMODE_WRITE
Bfile_WriteFile(fichier, buffer, 8);
Bfile_CloseFile(fichier);// on ferme le fichier
}
void chargerAchievements(int *pAchievements)
{
int couleur;
FONTCHARACTER fileName[] = { '\\', '\\', 'f', 'l', 's', '0', '\\', 'F', 'r', 'u', 'i', 't', '.', 'a', 'c', 'h', 0};
int fichier, i;
int achievements[NB_ACHIEVEMENTS];
loading();
for(i=0; i<NB_ACHIEVEMENTS; ++i)
{
achievements[i] = 0;
}