Escolar Documentos
Profissional Documentos
Cultura Documentos
In the final app of the book, we decided to get really ambitious and create a
multilevel game that uses both the phone’s orientation sensors and the touch
screen.
At some point, we used all our problem-solving strategies to deal with this app’s
complexity (decomposing problems, getting out a pencil, prototyping, recycling,
commenting our programs, involving users, and testing).
The final game took about a week to make from scratch, but prior to that we had a
bunch of ideas and prototypes.
Here’s Paula’s early prototype of the game that inspired the final app.
The idea is to tilt the phone so the ball rolls between the blocks until it reaches
the bottom of the screen. At the same time, the blocks can be moved around by
dragging them with your finger.
From start to finish, we made lots of small prototypes of the way the app looked
and the way it played.
Here are some of the problems we encountered along the way:
Learning Point:
Prototyping The first computer mouse was designed using a roll-on deodorant tube
and a butter dish. It didn’t work with a computer, of course, but the prototype
helped people understand the idea and think about how a computer mouse might work.
In app development, you might prototype a user interface to see how an app would
look, without worrying about the blocks.
You could also prototype some of the blocks to see how the app would work, without
worrying about the interface.
App prototypes are just early versions of part of the app to help programmers and
users find and solve problems.
Ponto de aprendizagem:
Prototipagem O primeiro mouse de computador foi projetado usando um tubo de
desodorante roll-on e um prato de manteiga. Não funcionou com um computador, é
claro, mas o protótipo ajudou as pessoas a entender a ideia e pensar em como um
mouse de computador poderia funcionar.
No desenvolvimento de aplicativos, você pode prototipar uma interface de usuário
para ver como um aplicativo ficaria, sem se preocupar com os blocos.
Você também pode prototipar alguns dos blocos para ver como o aplicativo
funcionaria, sem se preocupar com a interface.
Os protótipos de aplicativos são apenas versões anteriores de parte do aplicativo
para ajudar os programadores e os usuários a encontrar e resolver problemas.
Um penguin sliding about on ice made sense in the context of the game—the motion is
similar to a ball rolling around a maze.
We would start the penguin at the top of the screen, and it would have to slide
around obstacles to reach an exit point at the bottom of the screen.
We named our penguin Gentoo, after a species of Antarctic penguins, and she’s
female (because there are so many male game characters).
This was a good start, but Mario faces Bowser, Pac-Man is hunted by ghosts, and
those Angry Birds are angry at the pesky pigs—what we needed was a villain.
Our idea was to make a Yeti that had the power to turn Gentoo into a block of ice,
sending her back to the beginning.
The rules of the game developed from these ideas, and here’s what we ended up with:
- Gentoo must travel along an icy path from top left on the screen to bottom left.
She starts with five lives.
- If Gentoo falls into the sea, she loses a life and starts back at the beginning
of the current level.
- A Yeti moves randomly along the path. If it touches Gentoo, she freezes, loses a
life, and returns to the beginni
- Gentoo has a stock of five snowballs that she can fire at the Yeti. A snowball
hit freezes the Yeti for 5 seconds. During this time, Gentoo can touch the Yeti
without freezing.
- A fish appears and disappears at random intervals. If Gentoo eats the fish, she
gains a life.
- Gentoo scores 10 points for hitting the Yeti with a snowball, 50 points for
completing a level, and 500 points for completing all the levels.
- If Gentoo completes all the levels, the game cycles back to the first level and
resets the number of snowballs to five.
Este foi um bom começo, mas Mario enfrenta Bowser, Pac-Man é caçado por fantasmas,
e os Angry Birds estão com raiva dos porcos irritantes - o que precisávamos era de
um vilão.
Nossa idéia era fazer um Yeti que tivesse o poder de transformar o Gentoo em um
bloco de gelo, mandando-a de volta ao começo.
As regras do jogo se desenvolveram a partir dessas ideias, e eis o que acabamos
fazendo:
- Se Gentoo cai no mar, ela perde uma vida e recomeça no começo do nível atual.
- O Gentoo tem um estoque de cinco bolas de neve que ela pode disparar no Yeti. Um
golpe de bola de neve congela o Yeti por 5 segundos. Durante esse tempo, o Gentoo
pode tocar o Yeti sem congelar.
- O Gentoo pontua 10 pontos por atingir o Yeti com uma bola de neve, 50 pontos por
completar um nível e 500 pontos por completar todos os níveis.
Também fizemos animações stop-frame nas quais alteramos as imagens um pouco por vez
para gerar uma série de imagens que poderiam ser carregadas no App Inventor.
(Você já sabe do aplicativo Creepy Spider como transformar essas imagens em sprites
animados.)
Uma vez que tivemos uma animação para o Gentoo e o Yeti andando, criamos animações
para o Gentoo espirrar no mar e ser congelado. Finalmente, criamos uma imagem de
peixe, um poste de baliza e uma bola de neve para uma única imagem de Yeti para
quando o Gentoo o congelar com uma bola de neve (só precisávamos de uma imagem
porque o Yeti não é animado quando é splatted).
Usamos o Serif DrawPlus para fazer isso, mas há muitos outros softwares que você
pode usar.
Aqui estão alguns exemplos dos gráficos que criamos:
TIP
Have you noticed that Gentoo and the Yeti face forward rather than left or right?
That helps you because, as you saw in the Hungry Spider app, if you want sprites
that can face left and right, you have to produce two sets of images and write
blocks of code that can switch between them depending on which direction the sprite
is travelling.
Having the characters face the player means you cut down on a lot of coding! If
you’re familiar with MIT’s Scratch programming interface (http://scratch.mit.edu/),
you know there are sprite controls to do this hard work automatically—hopefully
we’ll see something similar in App Inventor very soon.
DICA
Você notou que o Gentoo e o Yeti estão voltados para a frente, e não para a
esquerda ou para a direita? Isso ajuda você, porque, como você viu no aplicativo
Hungry Spider, se você quiser sprites que podem ser virados para a esquerda e para
a direita, você precisa produzir dois conjuntos de imagens e escrever blocos de
código que podem alternar entre eles dependendo de qual direção o sprite viajando.
Ter os personagens enfrentando o jogador significa que você reduz bastante a
codificação!
Se você está familiarizado com a interface de programação do Scratch do MIT
(http://scratch.mit.edu/), sabe que existem controles de sprite para fazer esse
trabalho de forma automática.
Esperamos ver algo semelhante no App Inventor em breve.
Designing the levels What could you change about each level to make it more
challenging? You have lots of choices here: make the Yeti faster, add more Yetis,
add ice that is more slippery, reduce the number of times the fish appears, and so
on.
We settled on a simple example to start with, which changes the following items
with each new level:
- The path that Gentoo travels gets narrower and more complicated.
Once we had the level changes working, we could try out additional ideas to make
each level harder.
Projetando os níveis O que você poderia mudar em cada nível para torná-lo mais
desafiador? Você tem muitas opções aqui: tornar o Yeti mais rápido, adicionar mais
Yetis, adicionar gelo mais escorregadio, reduzir o número de vezes que o peixe
aparece e assim por diante.
Para começar, estabelecemos um exemplo simples, que altera os seguintes itens em
cada novo nível:
Help Gentoo escape the Yeti by tilting your phone to move her along the icy path
from the top of the screen to the goal at the bottom.
Sneak past the Yeti by touching the screen to throw a snowball.
Eat blue fish to gain extra lives.
APP RATING 5
Ajude o Gentoo a escapar do Yeti, inclinando o telefone para movê-lo pelo caminho
gelado da parte superior da tela até a meta na parte inferior. Esgueirar-se passado
o Yeti tocando a tela para lançar uma bola de neve. Coma peixe azul para ganhar
vidas extras.
AVALIAÇÃO 5
Fundos de tela:
SplashSound: splash.mp3
FreezeSound: freeze.mp3
VictorySound: victor.mp3
SplatSound: splat.mp3
GameOverSound: gameover.mp3
OneUpSound: oneup.mp3
YetiSound: yeti.mp3 LevelSound: LevelUp.mp3
WhooshSound: whoosh.mp3
The screen setup is straightforward, but there are a lot of media files to import.
Take your time doing this; wait for each one to upload fully before moving on to
the next one.
You’ll have a lot to keep track of in this game. Make a quick list now of the
variables you think you’ll need. Following you’ll find our final list. We have
three sorts of variables: those that keep track of gameplay information like the
score, those that set the speed of sprites, and those that control the animation of
sprites. The variable penguinspeed isn’t changed anywhere in the program, but it’s
a useful variable when you want to test what speed works best on your phone. You
could also use it to change the difficulty of each level: for example, you could
create a red fish that makes Gentoo move at half speed for 30 seconds.