M

main loop, 94

main menu screen, 237-241, 451-454,

592-595 MainMenu class, 227 MainMenu screen, 227 mainmenu.png, 231 MainMenuScreen, 237, 239, 241, 246,

449, 455 MainMenuScreen.java file, 592 MainMenuScreen.render( ) method, 597 MainMenu.update( ) method, 227 <manifest> element, 105, 107, 109-110,

112-113,627 manifest files, 104-115

<activity> element, 107-109 <application> element, 105-107 defining game icons, 114-115 game project setup, 112-114 <manifest> element, 105 <uses-feature> element, 110-111 <uses-permission> element, 109-110

<uses-sdk> element, 112 manifest.xml file, 108 Manual option, Target tab, 42 Map class, 182 marketing apps, 634 mass, 366-367 Material class, 540, 545 materials overview, 533 specifying, 539-540 Math equivalent, 359 Math.atan2( ) method, 359 Math.sin(cannonAngle), 369 matrices, 275-276

2D transformations with model-view, 326-338 combining transformations,

335-338 example using translation,

329-333 matrices, 328-329 rotation, 334-335 scaling, 335

world and model space, 326-328 modes, 289 projection, 289-292 code snippet, 292 matrix modes and active matrices, 289 orthographic projection with glOrthof method, 289-292 and transformations, 511-524 matrix stack, 512-514 simple camera system, 520-524 Matrix class, 526, 529, 554 Matrix methods, 556 Matrix.multiplyMV( ) method, 529 Matrix.rotateM( ) method, 529 Matrix.setIdentityM( ) method, 529 maxIndices, 319 Media support, 7 MediaPlayer class, 154, 188-192 MediaPlayer.isPlaying( ) method, 156, 191

MediaPlayer.pause( ) method, 157, 190

MediaPlayer.prepare( ) method, 155-156

MediaPlayer.release( ) method, 191 MediaPlayer.resume( ) method, 157 MediaPlayer.setDataSource( ) method, 154

MediaPlayer.start( ) method, 155-157, 190-191

MediaPlayer.stop( ) method, 156, 190 memory and performance profile, 11 meshes, defining, 504-510 cubes, 505-508 example, 508-510 mHeight variable, 376-377 Mini or Micro SD card storage, 13 minSdkVersion attribute, 112 minU variable, 376 minV variable, 376 minX variable, 376 minY variable, 376 mipmapping, 548-553 mobile gaming, 20-23 casual and hardcore, 22 large audience, 20-21 low entry barrier, 22-23 permanent connectivity, 21-22 model space, 326-328 Model-View-Controller design pattern.

See MVC design pattern model-view matrix, 326-338

combining transformations, 335-338 example using translation, 329-333 matrices, 328-329 rotation, 334-335 scaling, 335

world and model space, 326-328 models for color, 84 loading, 564-571 limitations, 571 OBJ loader, 570 Wavefront OBJ format, 565-566 MotionEvent class, 131, 138, 203 MotionEvent.ACTION_CANCEL event, 128

MotionEvent.ACTION_DOWN event,

128-129, 132-133 MotionEvent.ACTION_MOVE event, 128, 133

MotionEvent.ACTION_POINTER_DOWN

event, 133 MotionEvent.ACTION_POINTER_ID_SHI

FT event, 132 MotionEvent.ACTION_POINTER_UP

event, 133 MotionEvent.ACTION_UP event, 128,

131-133

MotionEvent.getAction( ) method, 128,

132-133 MotionEvent.getPointerCount( )

method, 133, 136 MotionEvent.getPointerId( ) method, 133

MotionEvent.getPointerIdentifier(int pointerIndex) method, 132 MotionEvent.getX( ) method, 128,

132-133 MotionEvent.getY( ) method, 128, 132-133

motivation, SurfaceView class, 178 Motorola Droid, 17 MOVE_LEFT state, 604 MOVE_RIGHT state, 604 Mr. Nom game, 229-267 abstracting, 247-267

GameScreen class, 260-267 MVC design pattern, 248-259 creating assets, 229-231 default Activity class, 232-237 Assets class, 233 LoadingScreen class, 236-237 Settings class, 234-235 HelpScreen classes, 241-243 high-scores screen, 243-247 implementing, 245-247 rendering numbers, 243-245 main menu screen, 237-241 setting up project, 232 .mrnom file, 235, 448 MrNomGame.getStartScreen( ) method, 236

mul( ) method, 359, 528 multiplayer functionality, 638 multitouch code, 200 multitouch events overview, 127 processing, 131-137

action mask event type, 133 pointer IDs and indices, 132-133 MultiTouchHandler class, 204-208, 215, 225

Murphy, Mark, 120 music and sound, 442-443, 586 streaming, 154-158 Music class, 187-192, 445 Music instance, 79, 446 Music interface, 79 music.mp3 file, 586 music.ogg file, 157 MVC (Model-View-Controller) design pattern, 248-259 Snake and SnakePart classes,

250-255 Stain class, 250 World class, 255-259

determining when game is over, 257

implementing, 257-259 placing stains, 256 time-based movement, 255-256 mWidth variable, 376-377 myapp.apk file, 49 MyAwesomeGame class, 97 myawesometext.txt file, 145 myfile.txt file, 49

MySuperAwesomeGame class, 99 MySuperAwesomeGame.getStartScree n( ) method, 99 MySuperAwesomeStartScreen class, 97-99

MySuperAwesomeStartScreen.dispose(

) method, 100 MySuperAwesomeStartScreen.pause( )

method, 100 MySuperAwesomeStartScreen.render( ) method, 99-100

MySuperAwesomeStartScreen.resume(

) method, 100 MySuperAwesomeStartScreen.update( )

method, 99-100 MySuperAwesomeStartScreen.x member, 100

0 0

Post a comment