Planete-casio.fr
Forums Casio - Problèmes de programmation ou avec un programme
Index du Forum |
Problèmes de programmation ou avec un programme |
Problème avec le SDK
Posté le 14/10/2007 18:31
Problème avec le SDK: Bonjour. Je viens de me mettre au sdk et je rencontre un petit problème sur le menu de mon jeu. Normalement en bougeant les flèches haut et bas le curseur devrait bouger mais là rien.
Regarder le code:
#include fxlib.h
#include <revolution.h>
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int key;
Bdisp_AllClr_DDVRAM();
intro();
menu();
return 1;
}
intro(){
unsigned long buffer1[] = {0x00000000,...};
unsigned long buffer2[] = {0x00000000,...};
GrayLinkBuffers(&buffer1, &buffer2);
Bdisp_AllClr_DDVRAM();
while( IsKeyUp(KEY_CTRL_EXE) )
{
GrayLinkBuffers(buffer1,buffer2);
GrayInit(3273,1452);
}
GrayEnd();
}
menu(){
int a,k,key;
a=20; //variable du curseur
PrintXY(24,20,Nouveau perso,0);
PrintXY(24,27,Charger,0);
PrintXY(24,34,Quitter,0);
Bdisp_PutDisp_DD();
lbl1:
Bdisp_DrawLineVRAM(20,a+1,20,a+3);
Bdisp_SetPoint_VRAM(21, a+2, 1);
Bdisp_PutDisp_DD();
lbl2:
key=0;
do{
GetKey(&key);
}while(key==0);
if(key 28 && key 37 && key 31)
{
goto lbl2;
}
if(key==28)
{
a=a-27;
if(a<20)
{
a=24;
}
goto lbl1;
}
if(key==37)
{
a=a+7;
if(a>34)
{
a=20;
}
goto lbl1;
}
}
//PAS TOUCHE
#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
Merci de bien vouloir m'aider
Posté le 14/10/2007 20:13 |
Bonjour,
Tu devrais à tout prix éviter les goto en C. Fais plutôt des fonctions. Ton problème vient sans doute de là.
---------------------------------- Calculatrices : Fx 92 Collège, Graph 25, Graph 65, Graph 85, Graph 100, Classpad 300.
Posté le 14/10/2007 21:57 |
Doucement je débute Comment je fais ça car les goto c'était bien pratique dans le basic
Posté le 14/10/2007 22:48 |
#include fxlib.h
#include <revolution.h>
int AddIn_main(int isAppli, unsigned short OptionNum)
{
unsigned int key;
Bdisp_AllClr_DDVRAM();
intro();
menu();
return 1;
}
intro(){
unsigned long buffer1[] = {0x00000000,...};
unsigned long buffer2[] = {0x00000000,...};
GrayLinkBuffers(&buffer1, &buffer2);
Bdisp_AllClr_DDVRAM();
while( IsKeyUp(KEY_CTRL_EXE) )
{
GrayLinkBuffers(buffer1,buffer2);
GrayInit(3273,1452);
}
GrayEnd();
}
fonction1(int a){
Bdisp_DrawLineVRAM(20,a+1,20,a+3);
Bdisp_SetPoint_VRAM(21, a+2, 1);
Bdisp_PutDisp_DD();
}
fonction2(){
int key=0;
do{
GetKey(&key);
}while(key==0);
}
menu(){
int a,k,key;
a=20; //variable du curseur
PrintXY(24,20,Nouveau perso,0);
PrintXY(24,27,Charger,0);
PrintXY(24,34,Quitter,0);
Bdisp_PutDisp_DD();
if(key 28 && key 37 && key 31)
{
fonction2();
}
if(key==28)
{
a=a-27;
if(a<20)
{
a=24;
}
fonction1(a);
}
if(key==37)
{
a=a+7;
if(a>34)
{
a=20;
}
fonction1(a);
}
}
//PAS TOUCHE
#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
---------------------------------- Calculatrices : Fx 92 Collège, Graph 25, Graph 65, Graph 85, Graph 100, Classpad 300.
Posté le 15/10/2007 21:16 |
A oui c'est sûr que c'est mieux
Index du Forum |
Problèmes de programmation ou avec un programme |
Problème avec le SDK
www.planete-casio.fr v3.0 © crée par Neuronix et Muelsaco 2007
Il y a 10 connectés |
Nous contacter |
Recherches effectuées |
Liens |
Forum Commun Casio