[C] BALLES REBONDISSANTES EN SDL

underprog Messages postés 19 Date d'inscription samedi 7 novembre 2009 Statut Membre Dernière intervention 16 mai 2010 - 16 mai 2010 à 11:29
underprog Messages postés 19 Date d'inscription samedi 7 novembre 2009 Statut Membre Dernière intervention 16 mai 2010 - 16 mai 2010 à 11:29
Cette discussion concerne un article du site. Pour la consulter dans son contexte d'origine, cliquez sur le lien ci-dessous.

https://codes-sources.commentcamarche.net/source/51759-c-balles-rebondissantes-en-sdl

underprog Messages postés 19 Date d'inscription samedi 7 novembre 2009 Statut Membre Dernière intervention 16 mai 2010
16 mai 2010 à 11:29
Salut,

tu peux simplifier un peu, dans la fonction rebond :

-------

if(posi.x<0 || posi.x>600 || posi.y<0 || posi.y>400){

switch(*deplacement){

// Traitement

}
}

-------

a+
Rejoignez-nous