startgames android aula 2
DESCRIPTION
Conheça mais em GrupoAlves.net e seja um desenvolvedor de jogos.TRANSCRIPT
![Page 1: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/1.jpg)
Física em Jogos
com Android
Aula 2
![Page 2: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/2.jpg)
Desenvolvimento de Jogos para Celulares e Tablets em Android
Introdução ao Desenvolvimento de Jogos em Android
Implementando Física em Jogos com Android
Disponibilizando o Jogo para o Mundo
Interatividade nos Jogos
Montando o seu Jogo de Sucesso em Android
![Page 3: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/3.jpg)
http://www.softonic.com.br/awards-results
![Page 4: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/4.jpg)
![Page 5: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/5.jpg)
- Colisão
- Aceleração (movimento)
- Sensores
Fonte: Tecmundo
![Page 6: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/6.jpg)
![Page 8: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/8.jpg)
Exemplo 1 – em www.grupoalves.net
if(line.collidesWith(face)){
line.setColor(1, 0, 0);
} else {
line.setColor(0, 1, 0);
}
Ou
if(face.collidesWith(face)){
face.colide();
} else {
face.normal();
}
![Page 10: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/10.jpg)
Exemplo 2 – em www.grupoalves.net
private static class Ball extends AnimatedSprite {
private final PhysicsHandler mPhysicsHandler;
public Ball(final float pX, final float pY, final TiledTextureRegion pTextureRegion) {
super(pX, pY, pTextureRegion);
this.mPhysicsHandler = new PhysicsHandler(this);
this.registerUpdateHandler(this.mPhysicsHandler);
}
![Page 11: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/11.jpg)
Exemplo 2 – em www.grupoalves.net
@Override
protected void onManagedUpdate(final float pSecondsElapsed) {
if(this.mX < 0) {
this.mPhysicsHandler.setVelocityX(DEMO_VELOCITY);
} else if(this.mX + this.getWidth() > CAMERA_WIDTH) {
this.mPhysicsHandler.setVelocityX(-DEMO_VELOCITY);
}
if(this.mY < 0) {
this.mPhysicsHandler.setVelocityY(DEMO_VELOCITY);
} else if(this.mY + this.getHeight() > CAMERA_HEIGHT) {
this.mPhysicsHandler.setVelocityY(-DEMO_VELOCITY);
}
super.onManagedUpdate(pSecondsElapsed);
}
}
![Page 12: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/12.jpg)
Exemplo Online – em www.grupoalves.net
![Page 13: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/13.jpg)
Exemplo Online EXTRA – em www.grupoalves.net
![Page 14: StartGames Android aula 2](https://reader033.vdocuments.pub/reader033/viewer/2022052908/559582801a28ab09548b4660/html5/thumbnails/14.jpg)
Aula 3
Próxima Aula....
Interatividade nos Jogos