CONNEXION
  • RetourJeux
    • Sorties
    • Hit Parade
    • Les + populaires
    • Les + attendus
    • Soluces
    • Tous les Jeux
    • Gaming
  • RetourActu Gaming
    • News
    • Astuces
    • Tests
    • Previews
    • Toute l'actu gaming
  • RetourBons plans
    • Bons plans
    • Bons plans Smartphone
    • Bons plans Hardware
    • Bons plans Image et Son
    • Bons plans Amazon
    • Bons plans Cdiscount
    • Bons plans Decathlon
    • Bons plans Fnac
    • Tous les Bons plans
  • RetourJVTech
    • Actus High-Tech
    • Intelligence Artificielle
    • Smartphones
    • Mobilité urbaine
    • Hardware
    • Image et son
    • Tutoriels
    • Tests produits High-Tech
    • Guides d'achat High-Tech
    • JVTech
  • RetourCulture
    • Actus Culture
    • Culture
  • RetourVidéos
    • A la une
    • Gaming Live
    • Vidéos Tests
    • Vidéos Previews
    • Gameplay
    • Trailers
    • Chroniques
    • Replay Web TV
    • Toutes les vidéos
  • RetourForums
    • Hardware PC
    • PS5
    • Switch 2
    • Xbox Series
    • Switch
    • Pokemon pocket
    • FC 25 Ultimate Team
    • League of Legends
    • Tous les Forums
  • PC
  • PS5
  • Xbox Series
  • Switch 2
  • PS4
  • One
  • Switch
  • iOS
  • Android
  • MMO
  • RPG
  • FPS
En ce moment Genshin Impact Valhalla Breath of the wild Animal Crossing GTA 5 Red dead 2
Forum
  • Accueil
  • Actus
  • Tests
  • Vidéos
  • Images
  • Soluces
  • Forum
Liste des sujets

(¯`·._• BlaBlaCube •_.·´¯)

Splouigh
Splouigh
Niveau 10
06 octobre 2012 à 13:55:11

Tiens, ça me fait penser que je devrais jouer à Terraria. :hap:

glooence
glooence
Niveau 10
06 octobre 2012 à 14:25:44

Mais si c'est simple :noel:

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:26:31

Mais pour toi normal. :noel:

glooence
glooence
Niveau 10
06 octobre 2012 à 14:26:57

je veut dire ça
int main()
{
printf("Hello worlds!");
return 0;
}

c'est quand même assez evident non? :noel:

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:27:32

C'est pour dire bonjour ? :noel:

glooence
glooence
Niveau 10
06 octobre 2012 à 14:27:40

oui :hap:

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:27:59

Ah j'ai compris alors. :noel:

glooence
glooence
Niveau 10
06 octobre 2012 à 14:34:04

glooence Voir le profil de glooence
Posté le 6 octobre 2012 à 12:30:26 Avertir un administrateur
int main()
{
printf("Hello worlds!");
return 0;
}

Tu vois?

HEIN ?
C'est pas simple, c'est Terraria avec l’œil de Cthulu !

bon alors :
ça c'est simple:
int main()
{
printf("Hello worlds!");
return 0;
}

quelque chose de compliqué c'est plutôt ça:
int main ( int argc, char** argv )
{
// initialisation des variables
FMOD_SYSTEM *system;
FMOD_SOUND *musique;
FMOD_SOUND *boom;
FMOD_RESULT resultat;
FMOD_RESULT result2;

FMOD_System_Create(&system);
FMOD_System_Init(system, 1, FMOD_INIT_NORMAL, NULL);

/* On ouvre la musique */
resultat = FMOD_System_CreateSound(system, "sound/fond.mp3", FMOD_SOFTWARE | FMOD_2D | FMOD_CREATESTREAM | FMOD_LOOP_NORMAL, 0, &musique);
result2 = FMOD_System_CreateSound(system,"sound/boom.mp3",FM
OD_SOFTWARE
| FMOD_2D ,0,&boom);
/* On vérifie si elle a bien été ouverte (IMPORTANT) */
if (resultat != FMOD_OK||result2!=FMOD_OK)
{
fprintf(stderr, "Impossible de lire le fichier mp3\n");
exit(EXIT_FAILURE);
}

/* On active la répétition de la musique à l'infini */
FMOD_Sound_SetLoopCount(musique, -1);

/* On joue la musique */
FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, musique, 0, NULL);

int continuer = 1;// booléen pour la boucle event
int i = 0;
int t = 0;
int j = 0;
int l = 0;
int v = 0;
int resetbase = 0;
int Bool=0;
int tempsprecedent = 0, tempsactuelle = 0;
int afficher=0;
int eteindre = 1;
SDL_Surface *ecran = NULL, *skinbase = NULL, *cursor=NULL,*explosion=NULL;
SDL_Surface *navrescue = NULL;
SDL_Surface *tableaugauche[3];
SDL_Surface *tableaudroit[3];
SDL_Surface *tableauxbas[3];
SDL_Surface *tableauhaut[3];
SDL_Surface *tableauback[3];
SDL_Surface *back = NULL;
SDL_Surface *debris = NULL;
SDL_Surface *brule = NULL;
SDL_Event event;
SDL_Event move;

SDL_Surface **pointeurBack = &back;
// initialisation de la SDL

SDL_Init(SDL_INIT_VIDEO);

// utilisation de la SDL

ecran = SDL_SetVideoMode(1240,720,32,SDL_HWSURFACE | SDL_FULLSCREEN | SDL_DOUBLEBUF);

// chargement des images
brule = SDL_LoadBMP("picture/BRULE.bmp");
back = SDL_LoadBMP("picture/fontstart.bmp");
debris = SDL_LoadBMP("picture/deagatcolateral.bmp");
skinbase = SDL_LoadBMP("picture/skinbase.bmp");
SDL_Surface *tableauExplosion[49];
int uc = 0;
for(uc;uc<50;uc++){tableauExplosion[uc] = SDL_LoadBMP("picture/deagatcolateral.bmp");}
tableaugauche[0] = SDL_LoadBMP("picture/skingun.bmp");
tableaugauche[1] = SDL_LoadBMP("picture/skingdeux.bmp");
tableaugauche[2] = SDL_LoadBMP("picture/skingtrois.bmp");

tableaudroit[0] = SDL_LoadBMP("picture/skinddeux.bmp");
tableaudroit[1] = SDL_LoadBMP("picture/skinddtrois.bmp");
tableaudroit[2] = SDL_LoadBMP("picture/skinddquatre.bmp");

tableauxbas[0] = SDL_LoadBMP("picture/skinbase.bmp");
tableauxbas[1] = SDL_LoadBMP("picture/skinbasedeux.bmp");
tableauxbas[2] = SDL_LoadBMP("picture/skinbasetrois.bmp");

tableauhaut[0] = SDL_LoadBMP("picture/skindedosun.bmp");
tableauhaut[1] = SDL_LoadBMP("picture/skindedosdeux.bmp");
tableauhaut[2] = SDL_LoadBMP("picture/skindedostrois.bmp");

tableauback[0] = SDL_LoadBMP("picture/fontstart.bmp");
navrescue = SDL_LoadBMP("picture/navrescue.bmp");
SDL_Rect positionnav;
positionnav.x = 130;
positionnav.y = 82;

cursor = SDL_LoadBMP("picture/cursor.bmp");
SDL_Rect positionCursor;
positionCursor.x = 1240/2;
positionCursor.y = 720/2;

explosion = SDL_LoadBMP("picture/explosion.bmp");
SDL_Rect positionExplosion;
positionExplosion.x = 0;
positionExplosion.y = 0;

SDL_Rect positionskin;
positionskin.x = 150;
positionskin.y = 150;

SDL_Rect positionback;
positionback.x = 0;
positionback.y = 0;
// gestion de la transparence
SDL_SetColorKey(cursor,SDL_SRCCOLORKEY,SDL_MapRGB(
cursor->format,255,255,255));

SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

SDL_SetColorKey(explosion,SDL_SRCCOLORKEY,SDL_MapR
GB(explosion->format,0,0,0));

SDL_SetColorKey(brule,SDL_SRCCOLORKEY,SDL_MapRGB(b
rule->format,6,251,0));

SDL_SetColorKey(navrescue,SDL_SRCCOLORKEY, SDL_MapRGB(navrescue->format, 0, 0, 0));
SDL_BlitSurface(skinbase,NULL,ecran,&positionskin)
;

SDL_BlitSurface(back,NULL,ecran,&positionback);
SDL_BlitSurface(navrescue,NULL,ecran,&positionnav)
;

SDL_Flip(ecran);

SDL_EnableKeyRepeat(50,50); //répetition des touches activés
SDL_ShowCursor(SDL_DISABLE);
// boucle event
while(eteindre)
{
while(continuer)
{
SDL_PollEvent(&event);
switch(event.type)
{
case SDL_KEYDOWN:
switch(event.key.keysym.sym)
{
case SDLK_ESCAPE:
eteindre = 0;
continuer = 0;
break;
case SDLK_d:
if(positionskin.x+64<1240)
{
//SDL_Delay(50);
positionskin.x++;
}
skinbase = tableaudroit[t];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

t++;
if(t > 2)
{
t = 0;
}
break;
case SDLK_w:
positionskin.y--;
skinbase = tableauhaut[l];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

l++;
if(l > 2)
{
l = 0;
}
break;
case SDLK_a:
positionskin.x--;
skinbase = tableaugauche[i];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

i++;
if(i > 2)
{
i = 0;
}
break;
case SDLK_s:
if(positionskin.y+64<720){
positionskin.y++;
skinbase = tableauxbas[j];
if(positionskin.y+64>650){afficher=1;}
}
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

j++;
if(j > 2)
{
j = 0;
}

break;
}
case SDL_MOUSEMOTION:
positionCursor.x=event.motion.x-29;
positionCursor.y=event.motion.y-33;
break;
case SDL_MOUSEBUTTONDOWN:
if(event.button.button==SDL_BUTTON_LEFT||event.but
ton.button==SDL_BUTTON_RIGHT){

FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, boom, 0, NULL);
positionExplosion.x=event.motion.x-32;
positionExplosion.y=event.motion.y-32;
Bool=1;
}
break;
// remise du personnage après arrêt de mouvement
case SDL_KEYUP:
switch(event.key.keysym.sym)
{
case SDLK_d:
skinbase = tableaudroit[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

t = 1;
break;
case SDLK_w:
skinbase = tableauhaut[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

l = 1;
break;
case SDLK_a:
skinbase = tableaugauche[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

i = 1;
break;
case SDLK_s:
skinbase = tableauxbas[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

j = 1;
break;
}
break;
}
if(positionskin.y == 0)
{
positionskin.y = 720 - 64;
continuer = 0;
}
//SDL_BlitSurface(tableauExplosion[],NULL,ecran,**

  • )

SDL_BlitSurface(tableauback[0],NULL,ecran,&positio
nback);

SDL_BlitSurface(skinbase,NULL,ecran,&positionskin)
;

SDL_BlitSurface(navrescue,NULL,ecran,&positionnav)
;

if(positionskin.x+32>1195){afficher = 1; }
if(afficher==1){SDL_BlitSurface(brule,NULL,ecran,&
positionskin);}

if(Bool==1){SDL_BlitSurface(explosion,NULL,ecran,&
positionExplosion);}

SDL_BlitSurface(cursor,NULL,ecran,&positionCursor)
;

SDL_Flip(ecran);

}

continuer = 1;
tableauback[0] = SDL_LoadBMP("picture/fondnext.bmp");
back = SDL_LoadBMP("picture/fondnext.bmp");
SDL_BlitSurface(back,NULL,ecran,&positionback);

//seconde boucle, second ecran

while(continuer && eteindre)
{
SDL_PollEvent(&move);
switch(move.type)
{
case SDL_KEYDOWN:
switch(move.key.keysym.sym)
{
case SDLK_ESCAPE:
eteindre = 0;
continuer = 0;
break;
case SDLK_d:
if(positionskin.x+64<1240)
{
//SDL_Delay(50);
positionskin.x++;
}
skinbase = tableaudroit[t];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

t++;
if(t > 2)
{
t = 0;
}

break;
case SDLK_w:
positionskin.y--;
skinbase = tableauhaut[l];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

l++;
if(l > 2)
{
l = 0;
}
break;
case SDLK_a:
positionskin.x--;
skinbase = tableaugauche[i];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

i++;
if(i > 2)
{
i = 0;
}
break;
case SDLK_s:
if(positionskin.y+64<720){
positionskin.y++;
skinbase = tableauxbas[j];
if(positionskin.y+64>650){afficher=1;}
}
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

j++;
if(j > 2)
{
j = 0;
}
break;
}
case SDL_MOUSEMOTION:
positionCursor.x=move.motion.x-29;
positionCursor.y=move.motion.y-33;
break;
case SDL_MOUSEBUTTONDOWN:
if(move.button.button==SDL_BUTTON_LEFT||move.butto
n.button==SDL_BUTTON_RIGHT){

FMOD_System_PlaySound(system, FMOD_CHANNEL_FREE, boom, 0, NULL);
positionExplosion.x=move.motion.x-32;
positionExplosion.y=move.motion.y-32;
Bool=1;
}
break;
// remise du personnage après arrêt de mouvement
case SDL_KEYUP:
switch(move.key.keysym.sym)
{
case SDLK_d:
skinbase = tableaudroit[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

t = 1;
break;
case SDLK_w:
skinbase = tableauhaut[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

l = 1;
break;
case SDLK_a:
skinbase = tableaugauche[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

i = 1;
break;
case SDLK_s:
skinbase = tableauxbas[resetbase];
SDL_SetColorKey(skinbase,SDL_SRCCOLORKEY,SDL_MapRG
B(skinbase->format,0,0,0));

j = 1;
break;
}
break;
}
//SDL_BlitSurface(tableauExplosion[],NULL,ecran,**

  • )

SDL_BlitSurface(tableauback[0],NULL,ecran,&positio
nback);

SDL_BlitSurface(skinbase,NULL,ecran,&positionskin)
;

if(afficher==1){SDL_BlitSurface(brule,NULL,ecran,&
positionskin);}

if(Bool==1){SDL_BlitSurface(explosion,NULL,ecran,&
positionExplosion);}

SDL_BlitSurface(cursor,NULL,ecran,&positionCursor)
;

SDL_Flip(ecran);

}
}

// fermeture de la SDL
FMOD_Sound_Release(boom);
FMOD_Sound_Release(musique);
FMOD_System_Close(system);
FMOD_System_Release(system);
int b=0;
for(b;b<4;b++){
SDL_FreeSurface(tableaudroit[b]);
SDL_FreeSurface(tableaugauche[b]);
SDL_FreeSurface(tableauxbas[b]);
SDL_FreeSurface(tableauhaut[b]);
SDL_FreeSurface(tableauback[b]);
}
b=0;
for(b;b<50;b++){SDL_FreeSurface(tableauExplosion[b
]);}

SDL_FreeSurface(explosion);
SDL_FreeSurface(cursor);
SDL_FreeSurface(skinbase);
SDL_FreeSurface(back);
SDL_FreeSurface(navrescue);
SDL_Quit;
return EXIT_SUCCESS;
}

tu vois? ^^

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:34:38

UUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUU

glooence
glooence
Niveau 10
06 octobre 2012 à 14:34:51

?

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:35:31

T'as vu la taille de ton truc. U_u

glooence
glooence
Niveau 10
06 octobre 2012 à 14:36:03

Bah, c'est ça un code complexe :noel:

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:36:49

Il fait quoi celui-là. :noel:

glooence
glooence
Niveau 10
06 octobre 2012 à 14:37:15

Plein de truc :noel:

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:37:54

Raconte. :noel:

glooence
glooence
Niveau 10
06 octobre 2012 à 14:40:13

Alors, il ouvre une fenêtre, avec un fond d'ecran, y'a un personnage que tu peu deplacer et qui donne l'impressions de marcher, tu brûle quand tu va dans la lave, y'a une musique de fond, avec la sourirs tu peu mettre des explosions qui fond un bruit explosif, si tu va en haut de l'ecran, tu change d'ecran, tu ferme la fenetre avec echap.
et j'oublies sûrement un ou deux truc :hap:

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:40:51

Tout ça pour ça. :pf:

glooence
glooence
Niveau 10
06 octobre 2012 à 14:41:10

bah c'est un debut de rpg en 2D :oui:

[N3utron]
[N3utron]
Niveau 10
06 octobre 2012 à 14:41:45

Ah c'est celui que tu fais.

glooence
glooence
Niveau 10
06 octobre 2012 à 14:42:49

oui, sauf que c'est un peu le bordel, on va sûrement recomencer en procédant autrement.

La vidéo du moment