Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "fxlib.h"
- #include "MonochromeLib.h"
- unsigned int key;
- int frame = 0;
- int veille = 10, x = 0, y =0, x1 = 0, y1 = 0;
- char block[] = {255,255,248,31,240,15,240,15,207,243,142,113,142,113,137,145,137,145,142,113,142,113,207,243,240,15,240,15,248,31,255,255};
- char cube10[] = {15,192,31,248,31,224,63,248,63,252,63,248,15,240,31,192,63,248,127,252,125,188,127,252,127,252,30,240,60,120,124,124};
- char cube11[] = {15,192,31,248,30,64,52,64,54,32,56,120,0,0,31,192,63,248,127,252,13,176,7,224,15,240,30,240,60,120,124,124};
- char cube20[] = {7,224,15,252,15,240,31,252,31,254,31,252,7,248,63,224,255,255,255,127,239,246,31,254,63,254,126,126,120,0,60,0};
- char cube21[] = {7,224,15,252,15,32,26,32,27,16,28,60,0,0,63,224,31,248,15,124,15,246,31,254,63,254,126,126,120,0,60,0};
- char cube30[] = {0,0,7,224,15,252,15,240,31,252,31,254,31,252,7,248,15,248,31,252,63,248,63,240,63,240,127,224,99,192,3,224};
- char cube31[] = {0,0,7,224,15,252,15,32,26,32,27,16,28,60,0,0,15,224,7,224,7,224,63,240,63,240,127,224,99,192,3,224};
- int tableau[4][8] = {{0,0,0,0,0,1,0,1}, {0,1,0,0,0,1,0,1}, {0,0,0,1,0,0,0,1} ,{1,0,0,0,0,1,0,0}};
- void dessin ()
- {
- ML_clear_vram();
- x1=0;y1=0;
- frame = frame +1;
- if (frame == 25)
- {
- frame = 0;
- }
- while (y1<4)
- {
- if (tableau[y1][x1] == 1)
- {
- ML_bmp_16_or(block, (x1*16), (y1*16));
- }
- x1++;
- if (x1 == 8)
- {
- x1=0;
- y1++;
- }
- }
- if (frame < 9)
- {
- ML_bmp_16_or(cube10, x, y);
- ML_bmp_16_and(cube11, x, y);
- }
- else if (frame < 17)
- {
- ML_bmp_16_or(cube20, x, y);
- ML_bmp_16_and(cube21, x, y);
- }
- else
- {
- ML_bmp_16_or(cube30, x, y);
- ML_bmp_16_and(cube31, x, y);
- }
- ML_display_vram();
- }
- int AddIn_main(int isAppli, unsigned short OptionNum)
- {
- ML_clear_vram();
- //dessin sur fond noir
- while (y1<4)
- {
- if (tableau[y1][x1] == 1)
- {
- ML_bmp_16_or(block, (x1*16), (y1*16));
- }
- x1++;
- if (x1 == 8)
- {
- x1=0;
- y1++;
- }
- }
- ML_bmp_16_and(cube10, x, y);
- ML_bmp_16_or(cube11, x, y);
- ML_display_vram();
- while(IsKeyDown(KEY_CTRL_EXE))
- {}
- while(1){
- if(IsKeyDown(KEY_CTRL_LEFT)&&x>0&&tableau[y/16][(x-1)/16] == 0)
- {
- x--;
- dessin();
- Sleep(veille);
- }
- if(IsKeyDown(KEY_CTRL_RIGHT)&&x<112&&tableau[y/16][(x+16)/16] == 0)
- {
- x++;
- dessin();;
- Sleep(veille);
- }
- if(IsKeyDown(KEY_CTRL_UP)&&y>0&&tableau[(y-1)/16][(x)/16] == 0)
- {
- y--;
- dessin();
- Sleep(veille);
- }
- if(IsKeyDown(KEY_CTRL_DOWN)&&y<48&&tableau[(y+16)/16][(x)/16] == 0)
- {
- y++;
- dessin();;
- Sleep(veille);
- }
- if(IsKeyDown(KEY_CTRL_AC))return;
- }
- }
- //A NE PAS TOUCHER
- #pragma section _BR_Size
- unsigned long BR_Size;
- #pragma section
- #pragma section _TOP
- int InitializeSystem(int isAppli, unsigned short OptionNum){return INIT_ADDIN_APPLICATION(isAppli, OptionNum);}
- #pragma section
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement