Index

image A

Android gaming, 3

Angry Birds/World of Warcraft, 6

collaborative environment, 7

2-D and 3-D game development, 10

development tools

developer site, 11, 12

Eclipse.org, 10, 11

IDE, 10

OpenGL ES installation, 1214

SDK download and install, 12

familiarity and lack of power, 4

full-time game developer, 6

game-development companies, 6

Java packages, 3

recoding, 7

RPG, 5

SDK, 4

Star Fighter game, 5

story writing, 10

game play details, 9

John Black character, 8, 9

Spy Hunter, 8

well-formatted Microsoft Word document, 7

version selection, 14

Android ImageView, 74

imageB

Background rendering

bitmap, 74

3-D effect, 74

finished backgrounds, 74

game activity, 75

game textures, 82, 83

game view creation, 76, 77

GLSurfaceView, 79

image loading

backgroundstars.png, 86

2-D graphics, 86

draw() method, 96

loadTexture() method, 9092, 95, 96

Motorola Droid model phone, 86

R.java file, 86

res/drawable-[density] folders, 86

res/drawable-nopi folder, 86

SFBackground.loadTexture() method, 87

texture mapping, 92, 94

vertices, textures, and indices, 8890

onDrawFrame() method, 80

onResume() and onPause(), 77, 79

onSurfaceChanged() method, 80

OpenGL Surface creation, 8082

quick thread pausing routine

game loop, 114, 116

GLSurfaceView renderer, 113

main menu, 117

onDrawFrame() method, 113

OpenGL buffers, 116, 117

SFEngine, 113

scrolling, 74

bgScroll1, 98

matrix modes, 99

OpenGL Matrices, 99101

scrollBackground1() method, 97

texture transformation, 101, 103, 104

second layer, 105, 106

bgScroll1 and bgScroll2, 105

cumulative scrolling factor, 105

debris.png, 104

float constant, 104

game-specific code, 105

loadTexture() method, 104

model matrix, 109111

scrollBackground2() method, 111, 112

scrolling method, 107, 108

texture loading, 106, 107

SFGame.java, 75

SFGameRenderer, 79

surface rendering, 84, 85

Bezier Curve

Cartesian points, 170

enemies class, 175

getNextScoutY() method, 171

left-hand side attacking, 172

quadratic, 170

SFEnemy() class, 171

SFGoodGuy class, 172

Star Fighter game, 170

t factor, 170

x axis value, 170

y axis value, 170

BHCorridor class

arbitrary texture, 275

BHGameRenderer.java file, 284

Blob Hunter project, 274

3-D corridor, 274

draw() method, 280283

drawCorridor() method, 284

gluLookAt(), 284

L shaped corridor, 274, 275

texture[] array, 277279

vertices[] array, 274276

wall texture addition, 283, 284

BHWalls class

code segment, 272

glTranslatef(), 272

OpenGL, 273

square wall shape, 271

unobstructed 360-degree view, 272

unobstructed portions, 271

Blob Hunter, 287

Blob Hunter 3-D game

BHEngine class, 259, 260

BHGameRenderer, 258, 259

BHGameView, 257

BHWalls class

creation, 261263

instantiation, 263, 264

BlobhunterActivity.java, 256, 257

constant creation, 260

vs. 2-D games, 255, 256

drawable-nodpi folder, 260

drawBackground() method, 267269

finishing touches, 269, 270

glOrthof() method, 265

gluPerspective() method, 266, 267

key parts, 256

loadTexture() method, 264

scout image, 260

imageC

Character creation, 119

character moving method, 143

draw() method, 142, 143

GL10, SFGameRenderer, 132

glScalef() function, 133

goodGuyBankFrames increment, 141

if else statement, 142

left movement, 138140

matrix model view, 134

movePlayer1() method, 133

PLAYER_RELEASE action, 136138

playerBankPosX variable, 134

right movement, 146, 148

right-banking animation, 148150

second frame, animation, 143, 145, 146

sprite sheet, 140, 141

switch statement, 133

texture matrix, 135, 140

FPS delay adjustment, 156, 157

game loop setting, 131, 132

loading a texture

game loop, 129, 130

PLAYER_BANK_LEFT_1, 129

PLAYER_BANK_LEFT_2, 129

PLAYER_FRAMES_BETWEEN_ANI, 129

PLAYER_RELEASE, 129

player's ship, 130

playerFlightAction variable, 127129

SFGameRenderer.java file, 131

SFGoodGuy() class, 122, 123

sprite animation

flip-book style effect, 120

glTranslateF() function, 121

Mario Brothers, 120

OpenGL render, 121

sprite sheet, 121

Star Fighter, 120

textures, 120

time-honored tools, 119

texture mapping arrays

draw() method, 124

full texture mapping, 124

loadTexture() method, 126, 127

SFBackground class, 124, 126

touch event

ACTION_UP and ACTION_DOWN trapping, 154156

MotionEvent parsing, 152154

onTouchEvent() listener, 151, 152

SFGame.java, 151

two-layer background scroll, 119

verticesarray, 123

imageD

3-D environment navigation

BHGameRenderer.java, 292

camera system, 291

control interface

BHEngine editing, 288

BlobhunterActivity, 288291

onTouchEvent() method, 288

Star Fighter, 287

corridorZPosition variable, 292

drawCorridor() method, 292

forward motion, 292

matrix multiplication, 291

OpenGL built-in tools, 291

player view adjustment, 293, 294

playerRotate variable, 292

switch case statement, 292

3-D first-person gaming, 272

2-D Star Fighter, 287

imageE

Enemy artificial intelligence

enemies[] array loop, 185, 186

enemyType property, 186

initialization, 182, 183

interceptor

players position locking, 189191

slope formula, 191, 193198

Star Fighter, 187

vertices adjustment, 188, 189

logic creation, 179, 181, 182

moveEnemy() method, 185

scout, 198

Bezier curve, 201203

random point, 199, 200

SFGameRenderer(), 177

sprite sheet loading, 183, 184

spriteSheets[] array, 178

TOTAL_INTECEPTORS, 177

TOTAL_SCOUTS, 177

TOTAL_WARSHIPS, 177

warship, 203, 205

Enemy class

common sprite sheet, 165

creation, 164

2-D gaming, 165

SFEnemy class creation

attack direction, 166

ATTACK_LEFT, 167

ATTACK_RANDOM, 167

ATTACK_RIGHT, 167

Bezier curve, 170

case statement, x-axis starting point, 169

constructor, 167

indication, 167

interceptor, locks, 168

posT, 169

scrolling shooters, 168

SFEnemy(), 166

SFEngine creation, 168

swift, predictable pattern, 168

TYPE_INTERCEPTOR, 167

TYPE_SCOUT, 167

TYPE_WARSHIP, 167

warship maneuvers, random pattern, 168

x and y positioning, 166

SFEnemy() package, 166

SFEngine class, 165

imageF

Frames per second (FPS) delay, 156, 157

imageG, H

Game publishing

AndroidManifest file, 243, 244

icon, 244

keystore

apk file, 251

4-bit boundaries, 252

creation window, 250, 251

destination and key/certificate checks window, 251, 252

selection window, 249, 250

project checks, 248, 249

project selection window, 247, 248

sign, align, and release, 244, 246, 247

versionCode and versionName, 244

imageI

Integrated development environment (IDE), 10

imageJ, K, L

Java class transformation

Android activity, 30

AndroidManifest.xml, 30

application nodes section, 31

attribution, activity, 31, 32

menu activity, 34

name attribute selector, 33

new element creation, 31

quick review, 34

screen orientation setting, 34

SFMainMenu activity, 32

snippet XML code, 31

StarfighterActivity, 33

imageM, N

Motorola Droid model phone, 86

moveEnemy() method, 205

imageO, P, Q

onDrawFrame() method, 205

OpenGL graphics, 13

OpenGL standard, 74

imageR

Role-playing game (RPG), 5

imageS

SFGame.java, 75

Silicon Graphics, 12

Software development kit (SDK), 4

Splash screen

benefits, 37

dragging image, 37

fade effects creation

accelerate_interpolator, 46

alpha animation, 46

android:duration property, 46

android-fromAlpha and android-toAlpha properties, 47

animation, 45

decelerate_interpolator, 47

fadein.xml file, 45

fadeout.xml file, 45

interpolator, 46

game threading

Android activities, architecture, 48

creation, 4951

killing activity, 52, 54

new intent setting, 51, 52

processor-intensive, 48

running games, 48

image creation, 35, 36

image importing, 36

layout file creation

Android XML File, 38, 39

FrameLayout, 40

image and text adding, 4143

image display, 38

StarfighterActivity connection, 4345

XML file editing, 39

nine-patch graphics, 36

nine-patch screen, 35

working, R.java file, 37, 38

Sprite sheet

adding, SFEngine class, 165

common sprite sheet, 165

2-D gaming, 165

good_guy sprite sheet, remove, 165

midgame housekeeping, 159, 160

SFEnemy class creation

attack direction, 166

ATTACK_LEFT, 167

ATTACK_RANDOM, 167

ATTACK_RIGHT, 167

Bezier curve, 170 (seealso Bezier Curve)

case statement, x-axis starting point, 169

constructor, 167

indication, 167

interceptor, locks, 168

posT, 169

scrolling shooters, 168

SFEnemy(), 166

SFEngine creation, 168

swift, predictable pattern, 168

TYPE_INTERCEPTOR, 167

TYPE_SCOUT, 167

TYPE_WARSHIP, 167

warship maneuvers, random pattern, 168

x and ypositioning, 166

SFEnemy(), 166

Star Fighter, 187

Star Fighter 2D arcade shooter, 27

Android platform, 27

layouts setting, 5658

main menu creation

button images adding, 54

exit button rest state, 54

layout folder, 55

layout_width and height properties, 55

pressed state exit button, 55

pressed state start button, 54

RelativeLayout layout, 55

start button, rest state, 54

music

AndroidManifest, 69

background music, 61

housekeeping function, 61

isRunning Boolean, 65, 67

MediaPlayer, 65, 66

musicThread(), 69

onCreate() method, 66

playing, 69, 71

raw folder, 62

service, 64, 65

SFMainMenu.java, 70

SFMusic service, 69

SPLASH_SCREEN_MUSIC, 63

variable, R_VOLUME and L_VOLUME, 63

warfieldedit.ogg, menu, 63

onClickListeners, 60, 61

screen, 28

splash screen

activity creation, 28

game main menu, 28

Java class transformation (see Java class transformation)

new Java class creation, 29

programe building, 27

wiring buttons, 58, 60

Star Fighter, 2-D shooter, 15

AF-718, 15

Captain John Starke, 15

game creation, 18

game details, 17

game engine, 1820

game-specific code, 20, 22, 23

Kordark Interceptors, 16

Kordark invasion fleet, ships, 16

Kordark Scouts, 16

Larash War Ships, 16

new Android project wizard, 24

project name, 24, 25

Star Fighter engine, 23

"Use default location" check box, 26

imageT, U, V

Texture class

glBindTextures() method, 163

glGenTextures() method, 162

loadTexture() method, 160

SFBackground() class, 162

SFGameSFGameRenderer() class, 164

SFGoodGuy() class, 160, 162

SFTextures(), 161

textureNumber parameter, 163

imageW, X, Y, Z

Weapon

collision detection

applyDamage() method, 222

collision damage, 219, 220

detectCollisions() Method, 220, 221

void shots removal, 222, 224

2-D collision detection, 207

firePlayerWeapons() method, 214, 215, 218, 219

initialization, 213, 214

screen, edge detection, 215218

SFWeapon() array, 211

sprite sheet, 208, 212

INTERCEPTOR_SHIELDS constant, 208

PLAYER_BULLET_SPEED constant, 208

SFEngine.java file, 208

SFWeapon class, 209211

SHOUT_SHIELDS, 208

space-fighting weapon, a blaster, 207

WARSHIP_SHIELDS constant, 208

WEAPONS_SHEET constant, 208

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.225.57.164