Développement XNA pour la XBox et le PC
XVI
CHAPITRE 6
Enrichir les sprites : textures, défilement, transformation,
animation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
97
Préparation de votre environnement de travail . . . . . . . . . . . . . . . . . . . . . .
97
Texturer un objet Rectangle . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
99
Modifier la classe Sprite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Faire défiler le décor : le scrolling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
Créer des animations avec les sprites sheets . . . . . . . . . . . . . . . . . . . . . . . . . . 108
Varier la teinte des textures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
Opérer des transformations sur un sprite . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Afficher du texte avec Spritefont . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Afficher le nombre de FPS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
En résumé . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
CHAPITRE 7
La sonorisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Travailler avec XACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Créer un projet sonore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Lire les fichiers créés . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Lire les fichiers en streaming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Ajouter un effet de réverbération . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Le son avec la nouvelle API SoundEffect . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Lire un son . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Lire un morceau de musique . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142
Pour un bon design sonore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
En résumé . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
CHAPITRE 8
Exceptions et gestion des fichiers : sauvegarder
et charger un niveau . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Le stockage des données . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Les espaces de stockage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Sérialisation et désérialisation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Les exceptions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
=Labat FM.book Page XVI Vendredi, 19. juin 2009 4:01 16
Précédent

- 17/366

Suivant