gerenciamento de telas
DESCRIPTION
Gerenciamento de Telas. Alexandre Tolstenko Nogueira [email protected] http://forum.gamux.com.br http://tolstenko.net Revisão : Erick “ Puyol ” Luis Moraes de Sousa. Papel e caneta na mão !. Revisão. Revisão. Estados JustPressed e JustReleased ; Deadzone ; GenericInput . - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/1.jpg)
![Page 2: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/2.jpg)
Gerenciamento de Telas
Alexandre Tolstenko [email protected]
http://forum.gamux.com.brhttp://tolstenko.net
Revisão: Erick “Puyol” Luis Moraes de Sousa
![Page 3: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/3.jpg)
REVISÃOPapel e caneta na mão!
![Page 4: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/4.jpg)
4
Revisão
1. Estados JustPressed e JustReleased;2. Deadzone;3. GenericInput.
Revisão!
![Page 5: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/5.jpg)
MOTIVOS
![Page 6: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/6.jpg)
6
Motivos
1. Grande empecilho quando se programa games;
2. Facilitar nossa vida quando queremos mudar de visões de jogo.
![Page 7: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/7.jpg)
OBJETIVO
![Page 8: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/8.jpg)
8
Objetivos
1. Conhecer e entender mais a fundo componentes de Jogo;
2. Conseguir iniciar um sistema de menus para jogos;
3. Transitar entre telas de jogo.
![Page 9: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/9.jpg)
GERÊNCIA DE TELASTratamento de telas de um jogo
![Page 10: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/10.jpg)
Teoria Prática
![Page 11: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/11.jpg)
Teoria
Drawable Game
ComponentScreen Layer Screen
ManagerLayer
Manager MVC(?)
![Page 12: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/12.jpg)
12
Drawable Game Component
• Componente de jogo que permite ser desenhado;
• Atualiza-se na mesma freqüência que o game;
• Estrutura semelhante a classe Microsoft.XNA.Framework.Game.
![Page 13: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/13.jpg)
Teoria
Drawable Game
ComponentScreen
Abertura Menu InGame
Layer Screen Manager
Layer Manager MVC(?)
![Page 14: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/14.jpg)
14
Abertura
![Page 15: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/15.jpg)
15
Menu
![Page 16: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/16.jpg)
16
InGame
![Page 17: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/17.jpg)
Teoria
Drawable Game
ComponentScreen Layer
GUI HUD
Screen Manager
Layer Manager MVC(?)
![Page 18: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/18.jpg)
18
GUI – Graphics User Interface
![Page 19: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/19.jpg)
19
HUD – Head-Up Display
![Page 20: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/20.jpg)
Teoria
Drawable Game
ComponentScreen Layer Screen
ManagerLayer
Manager MVC(?)
![Page 21: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/21.jpg)
21
Screen Manager
1. Controlador da visualização do game;2. Alterna telas;3. Controla estados de Telas;4. Empilha estados anteriores de telas:– Exemplo: Pause e InGame.
![Page 22: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/22.jpg)
Teoria
Drawable Game
ComponentScreen Layer Screen
ManagerLayer
Manager MVC(?)
![Page 23: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/23.jpg)
23
Layer Manager
1. Gerencia camadas;2. Organiza as informações do HUD;3. Implementa a GUI em cima do jogo;4. Camada mais baixa é o jogo em si e a mais
alta é a GUI e/ou HUD;5. Em um game de plataforma, existem várias
camadas de imagens para dar a impressão de profundidade.
![Page 24: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/24.jpg)
Teoria
Drawable Game
ComponentScreen Layer Screen
ManagerLayer
Manager MVC(?)
![Page 25: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/25.jpg)
25
MVC
![Page 26: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/26.jpg)
26
MVC para games
• Model:– Classes abstratas do que seria o modelo de
classes;• View:– Classes de telas e camadas;
• Controler:– Engine que controla e define o comportamento do
jogo.
![Page 27: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/27.jpg)
Teoria Prática
![Page 28: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/28.jpg)
28
Prática
• Prática:– Re-implementar algum game já feito tentando
usar a idéia de MVC voltada para games;– Adicionar as telas de Abertura, Menu, Créditos,
Opções, InGame para algum jogo seu;
• Desafio:– Transição de Pause-InGame.
![Page 29: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/29.jpg)
29
Etapas
1. Abertura;2. Migrar tela de abertura para Menu por
contador de tempo;3. Estados do Menu;4. Usar JustPressed para mudar para tela InGame;5. Implementar Pause e permitir que retorne à
tela de jogo anterior;6. Voltar para InGame.
![Page 30: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/30.jpg)
30
Diagrama Game
![Page 31: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/31.jpg)
31
Diagrama Engine
![Page 32: Gerenciamento de Telas](https://reader033.vdocuments.mx/reader033/viewer/2022061520/56815ed9550346895dcd7659/html5/thumbnails/32.jpg)
32
Agradecimento
spriteBatch.DrawString( Arial, "Obrigado Pela Atenção!", positionVect, Color.Black);