Escolar Documentos
Profissional Documentos
Cultura Documentos
SOUZA
2022
Gustavo Rabello Cardoso
2022
Dedicamos esse trabalho a todos os
envolvidos no projeto, em especial aos
pais e familiares dos integrantes do grupo,
também dedicamos aos nossos
professores.
AGRADECIMENTOS
Agradecemos a todos os envolvidos no projeto, passamos por muitas
dificuldades, mas conseguimos superá-las graças ao apoio dos professores, em
especial Rosa Mitiko Shimizu.
In our current society there are few games that address prejudice and social
inequality, considering that artistic expressions are very important for our era, having
strength and influence to change opinions and/or bring representativeness,
representations that address real and necessary themes, mainly the poorest people
and with a reality different from that of many are required, as leisure and
representation are often denied to the poor. As games are also forms of artistic
manifestations, with our game want to bring a vision to another reality, in addition to
amusing the public while informing them and bringing an important
representativeness that is lacking in the games scenario. In our project we present
the reality of a young man (Benedito) who lives in a community, going through
various difficulties, his mother abandons him, and he has to start working to support
himself, he has the help of a lady called “Dona Cleusa”, she owns an establishment
called “Bar da Dona Cleusa”, as well as being a mother figure to Benedito, she offers
him a job. The story continues with Bené delivering lunchboxes, until he begins to
hang around with presences of a dubious nature and is the target of a proposal that
puts him in a moral dilemma and makes him take the wrong decisions, but a
childhood friend called “Renatinha” helps him and he gives support to get out of this
situation, and even though he doesn't have ideological or family bases, he does the
right thing and ends up being “welcomed” by “Dona Cleusa”.
Escape (ESC)
JavaScript (JS)
Subversion (SVN)
1. INTRODUÇÃO ............................................................................................. 19
2. REFERENCIAL TEÓRICO........................................................................... 22
4. DESENVOLVIMENTO ................................................................................. 94
1. INTRODUÇÃO
Com isso tudo explicado, temos a premissa do jogo, Bené é um jovem negro
e pobre, morador de periferia. No alto de seus 16 anos ele é abandonado pela mãe
que é usuária de drogas e tendo em vista que seu pai é ausente, ele fica sozinho, no
meio de toda sua tristeza, confusão e medo. Nosso protagonista busca refúgio no
bar da Dona Cleusa, onde ele se torna responsável por entregar as marmitas do
restaurante e vai encarar diversos problemas e tentações que encontrará em sua
jornada.
21
1.1 Motivação
1.2 Desafio
1.3 Objetivo
2. REFERENCIAL TEÓRICO
Ao final do projeto, cada um dos membros do grupo possuiu como salário final
R$ 6.375,00 e o custo total dos profissionais do projeto foi de R$ 51.000,00. Assim,
a quantidade total de horas trabalhadas tendo sido de 6.800h, considerando um
expediente de seis horas diárias e o valor de R$ 7,50 por cada uma delas. O
detalhamento dos custos deste trabalho pode ser observado na Tabela 48.
13. Jogaria esse jogo: "Um garoto brasileiro, foge da sua realidade por meio do
funk e festas, vai atrás de bailes pelos estados do Brasil e então tem que
passar por diversas dificuldades e desafios até ficar bem consigo mesmo”?
A Unity é uma plataforma gratuita, ela oferece suporte para projetos pequenos e
independentes, além de ser compatível com o Visual Studio e o C#, e existem
muitos materiais de estudos na internet que auxiliam na construção do projeto, nós
estamos utilizando-o como motor gráfico para a produção do jogo.
33
O Heroku cobra de seus usuários com base no número de máquinas virtuais que
são necessárias para seus aplicativos. A plataforma Heroku e os aplicativos criados
pelo usuário usam Amazon Web Services como infraestrutura subjacente. Os
desenvolvedores podem obter um rápido desenvolvimento de aplicativos usando-o,
pois é bastante conveniente.
34
Estamos usando o Aseprite para fazer aquilo que ele foi criado para fazer,
sprites e pixel art, esse programa vem auxiliando de maneira indispensável nosso
projeto, sendo necessário para o progresso do trabalho de conclusão de curso. É
usado na criação dos personagens, modelagens de objetos, do chão, do céu, do
fundo dos níveis, dos inimigos. basicamente é utilizado na criação de tudo que está
presente no nosso jogo. Por último não menos importante, é usado para a criação
de animações como correr, pular e interagir com pessoas e objetos e dos inimigos
que o Benedito enfrenta ao longo do jogo.
36
O Draw.io está sendo utilizado para a confecção dos fluxogramas que são
necessários para uma análise do nosso software, explicando de maneira simples o
funcionamento dele, tanto do front-end quanto do back-end, por ter uma interface
simples e leve, ele tem uma aba de recursos voltados à arquitetura da informação,
mais um ponto positivo que nos ajuda na criação dos requisitados fluxogramas e
diagramas de caso de uso.
37
38
O Draw.io está sendo utilizado para a confecção dos fluxogramas que são
necessários para uma análise do nosso software, explicando de maneira simples o
funcionamento dele, tanto do front-end quanto do back-end, por ter uma interface
simples e leve, ele tem uma aba de recursos voltados à arquitetura da informação,
mais um ponto positivo que nos ajuda na criação dos requisitados fluxogramas e
diagramas de caso de uso.
42
Figura 13 - Ícone do C#
3. ANÁLISE DO SISTEMA
Esforço
10
8
6
4
2
0
Classificação: Obrigatório.
Ator: Usuário
Classificação: Obrigatório.
Ator: Usuário.
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
assim se movimentando.
Classificação: Opcional
Ator: Usuário
55
Classificação: Opcional
56
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
aumenta ou diminui.
Classificação: Opcional
Ator: Usuário
Classificação: Opcional
Ator: Usuário
Classificação: Obrigatório
Ator: Usuário
Classificação: Obrigatório
Ator: Usuário
Classificação: Obrigatório
Ator: Usuário
Requisitos que motivaram esse teste: RFU. 001 – Acessar o site: Acessar o
site diretamente da página “Home”.
Requisitos que motivaram esse teste: RFU. 002 – Baixar os arquivos do jogo:
O usuário deve realizar o download pelo
botão “baixar”.
esquerda.
Requisitos que motivaram esse teste: RFU. 005 – O personagem deve pular:
Ao pressionar a tecla “W” ele deve pular
uma ou duas vezes, dependendo da
quantidade de vezes em que a
respectiva tecla foi pressionada.
Requisitos que motivaram esse teste: RFU. 006 - O personagem deve interagir
com o cenário: No momento em que a tecla
“E” for pressionada o personagem deve
interagir com o cenário, trocando de fase,
falando com os personagens ou interagindo
com certos objetos.
Requisitos que motivaram esse teste: RFU. 007 – Testar o menu de pausa: Ao
pressionar a tecla “Esc” o jogo deve ser
pausado e um menu de pausa deve ser
apresentado.
Requisitos que motivaram esse teste: RFU. 008 – Testar os botões do menu
de pausa: Ao pressionar o botão
“Recomeçar” a fase deve ser reiniciada
desde o começo, assim apagando o
81
progresso do jogador.
Requisitos que motivaram esse teste: RFU. 009 – Testar os botões do menu
de pausa: Ao pressionar o botão
“Resumir”, o jogo deve ser “despausado”
o meu de pause fechado e o jogo deve
retornar de onde parou.
Requisitos que motivaram esse teste: RFU. 010 – Testar os botões do menu
de pausa: Ao pressionar o botão “Sair”, o
jogo é direcionado ao menu principal.
Requisitos que motivaram esse teste: RFU. 013 – Testar a funcionalidade dos
botões no menu de fases, onde usuário
pode selecionar e clicar na fase que ele
deseja continuar levando em conta seu
progresso dentro do jogo, esses botões
que ele pode clicar estão enumerados
de um a seis, clicando em uma dessas
fases o usuário inicia a respectiva fase
que ele selecionou.
menu de jogo.
Requisitos que motivaram esse teste: RFU. 018 – Ativar ou desativar o som do
jogo: ao marcar ou desmarcar a caixa de
“Som” o som do jogo é ativado ou
desativado.
menu principal.
Requisitos que motivaram esse teste: RFU. 021 - Testar o retorno ao menu
principal: ao pressionar o botão “X” o
menu de opções é fechado e retorna ao
menu principal.
Requisitos que motivaram esse teste: RFU. 023 – Testar a mecânica de pegar
a “marmita”: quando a “marmita” estiver
no chão o jogador deve passar por cima
dela, assim coletando a “marmita” e
podendo progredir no jogo.
Requisitos que motivaram esse teste: RFU. 024 – Testar a mecânica de matar
inimigos: ao pular e cair em cima de um
inimigo ele deve morrer mostrando uma
animação de morte do respectivo
inimigo.
Requisitos que motivaram esse teste: RFU. 025 – Testar a cena de morte: ao
sofrer muito dano ou cair do precipício o
personagem deve morrer, aparecendo
uma mensagem de morte e dando a
opção de o jogador sair para o menu
principal ou fechar o jogo.
3.6 Fluxograma
4. DESENVOLVIMENTO
4.1.1 Desenvolvimento JS
//Cria uma constante cuja função é selecionar a classe indicada entre os parênteses
//Cria uma constante cuja função é selecionar a classe indicada entre os parênteses
//Cria uma constante cuja função é selecionar a classe indicada entre os parênteses
//Cria uma constante cuja função é selecionar a classe indicada entre os parênteses
menu.addEventListener('click', () => {
menu.classList.toggle('active');
mobile_menu.classList.toggle('active');
});
document.addEventListener('scroll', () => {
//Cria uma estrutura que define que quando o valor da variável scroll_position for
maior que 250, a "header" passará a ter a cor #222222, caso o contrário sua cor é
transparente.
header.style.backgroundColor = '#222222';
} else {
header.style.backgroundColor = 'transparent';
});
menu_item.forEach((item) => {
item.addEventListener('click', () => {
menu.classList.toggle('active');
mobile_menu.classList.toggle('active');
});
});
96
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
</head>
<body>
<section id="header">
<div class="nav-bar">
<div class="brand">
<a href="#hero">
//Fecha a referencia
</a>
</div>
<div class="nav-list">
<div class="menu">
<div class="bar">
</div>
</div>
<ul>
//Cria um item com a tag "#hero" e que é clicável com a palavra "Home"
//Cria um item com a tag "#services" e que é clicável com a palavra "Personagens"
//Cria um item com a tag "#projects" e que é clicável com a palavra "Devs"
//Cria um item com a tag "#about" e que é clicável com a frase "Sobre o Jogo"
//Cria um item com a tag "#contact" e que é clicável com a palavra "Contato"
//Fecha a lista
</ul>
</div>
</div>
</div>
</section>
<section id="hero">
<div>
100
//Cria um título
//Cria um título
</div>
</div>
</section>
*{
padding: 0;
margin: 0;
box-sizing: border-box;
101
html {
font-size: 10px;
scroll-behavior: smooth;
background-color: #101010;
a{
text-decoration: none;
.container {
min-height: 100vh;
width: 100%;
display: flex;
102
align-items: center;
justify-content: center;
img {
height: 100%;
width: 100%;
object-fit: cover;
p{
color: white;
font-size: 1.4rem;
margin-top: 5px;
line-height: 2.5rem;
font-weight: 300;
letter-spacing: 0.05rem;
.section-title {
font-size: 3rem;
font-weight: 300;
color: white;
margin-bottom: 10px;
text-transform: uppercase;
letter-spacing: 0.2rem;
text-align: center;
.section-title span {
color: #5bf900;
.cta {
display: inline-block;
color: white;
background-color: transparent;
font-size: 2rem;
text-transform: uppercase;
letter-spacing: 0.1rem;
margin-top: 30px;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
{
106
if (other.gameObject.tag == "Paredes")
Movimento2.left = true;
if (other.gameObject.tag == "Paredes")
Movimento2.left = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
107
if (other.gameObject.tag == "Paredes")
Movimento2.right = true;
if (other.gameObject.tag == "Paredes")
Movimento2.right = false;
}
108
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
//declara váriavel global que define quando o jogador pode se movimentar ou não
//variaveis de direção
//Variaveis do audio
//força de repulsão
void Start()
left = false;
right = false;
fcRight = transform.localScale;
fcLeft = transform.localScale;
rb = GetComponent<Rigidbody2D>();
void Update()
direction = Input.GetAxis("Horizontal");
if(PlayerHP.playerhp == 0)
rb.velocity = Vector2.zero;
if (left == true)
111
colidiu = true;
if(right == true)
colidiu = true;
colidiu = false;
if (estaticoGlobal == true)
rb.constraints = ~RigidbodyConstraints2D.FreezePosition;
if (PlayerHP.tomoDano == true)
if (direita == true)
StartCoroutine("KnockBack");
if (esquerda == true)
112
StartCoroutine("KnockBack");
if (chaoTrue)
if (Input.GetAxis("Horizontal") != 0)
//esta andando
animacao.SetBool("andando", true);
animacao.SetBool("parado", false);
animacao2.SetBool("andando", true);
animacao2.SetBool("parado", false);
else
//esta parado
animacao.SetBool("andando", false);
animacao.SetBool("parado", true);
animacao2.SetBool("andando", false);
animacao2.SetBool("parado", true);
}
113
//se ele apertar os botões de pulo uma força positiva é aplicada ao personagem no
eixo Y
if (podePular == true)
pulando.Play();
if (chaoTrue == true)
animacao.SetBool("pulando", false);
animacao2.SetBool("pulando", false);
if (chaoTrue == false)
animacao.SetBool("pulando", true);
animacao.SetBool("andando", false);
animacao2.SetBool("pulando", true);
animacao2.SetBool("andando", false);
//Define se os valores atendem os requisitos para que o player possa efetuar pulo
duplo
114
pulando.Play();
pulosExtras--;
if (chaoTrue)
pulosExtras = 1;
if(direction == -1 || direction == 1)
bGround = true;
else
bGround = false;
//Se ele se mover para a esquerda a imagem do personagem se vira para o lado
esquerdo
if (direction > 0)
player.localScale = fcRight;
player2.localScale = fcRight;
direita = true;
115
esquerda = false;
//Se ele se mover para a direita a imagem do personagem se vira para o lado direito
if (direction < 0)
player.localScale = fcLeft;
player2.localScale = fcLeft;
direita = false;
esquerda = true;
if (colidiu == false)
if (PlayerHP.tomoDano == false)
if(colidiu == true)
if(right == true)
if(direction < 0)
if (left == true)
if (direction > 0)
if (estaticoGlobal == false)
if (PlayerHP.playerhp != 0)
rb.constraints = RigidbodyConstraints2D.FreezePositionX;
animacao.SetBool("andando", false);
animacao.SetBool("parado", true);
animacao2.SetBool("andando", false);
animacao2.SetBool("parado", true);
IEnumerator KnockBack()
PlayerHP.tomoDano = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
//componentes de som
//objetos da cena
//objeto da cena
//animação do jogador
void Start()
playerhp = 2;
playerhp = playerHp;
jogador = GetComponent<Animator>();
player = GetComponent<CapsuleCollider2D>();
void Update()
{
120
if (recuperouMarmita == true)
marmitaSom.Play();
recuperouMarmita = false;
hpAtual = playerhp;
if(playerhp == 2)
FollowCamera.stpCamera = false;
marmita.SetBool("perdeu", false);
else if (playerhp == 1)
marmita.SetBool("perdeu", true);
else
if (perdeu == false)
FollowCamera.stpCamera = true;
StartCoroutine("GameOver");
perdeu = true;
}
121
if (other.gameObject.tag == "MorteQueda")
if (diferenciaSonsGmOver == 0)
somGmOver.Play();
diferenciaSonsGmOver++;
if (other.gameObject.tag == "Enemy")
playerhp--;
tomouDanoText.SetActive(true);
somTomouDano.Play();
TextoFlutuante.textAtiva = true;
if (playerhp == 1)
SetaOff.pegou = false;
jogador.SetBool("dano", true);
StartCoroutine("DamagePlayer");
player.enabled = false;
damageEnemy.SetActive(false);
tomoDano = true;
if (playerhp == 0)
122
if (diferenciaSonsGmOver == 0)
somGmOver.Play();
diferenciaSonsGmOver++;
player.enabled = false;
damageEnemy.SetActive(false);
tomoDano = true;
jogador.SetTrigger("morto");
Movimento2.estaticoGlobal = false;
theRB2D.constraints = RigidbodyConstraints2D.FreezePositionY;
playerColisor.enabled = false;
IEnumerator DamagePlayer()
jogador.SetBool("dano", false);
damageEnemy.SetActive(true);
123
sprite.enabled = false;
sprite.enabled = true;
player.enabled = true;
IEnumerator GameOver()
porta.enabled = false;
transicao.SetActive(true);
cenarioSons.SetActive(false);
personagemSons.SetActive(false);
gmOver.SetActive(true);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
124
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Player")
PlayerHP.playerhp = 0;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Update()
if (textAtiva == true)
//invoca rotina
StartCoroutine("DropText");
//rotina
IEnumerator DropText()
//intervalo de tempo
//desativa o componente
text.SetActive(false);
textAtiva = false;
}
126
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[RequireComponent(typeof(Collider2D))]
[SerializeField]
[SerializeField]
void Update()
if (_podeExecutar)
if(_jogadorInterage.EstaInteragindo)
if (onOff == false)
Movimento2.estaticoGlobal = false;
//invoca evento(s)
_botaoApertado.Invoke();
onOff = true;
else
{
128
Movimento2.estaticoGlobal = true;
//invoca evento(s)
_botaoApertado.Invoke();
onOff = false;
_podeExecutar = true;
_destacaIcone.enabled = true;
_podeExecutar = false;
_destacaIcone.enabled = false;
using System.Collections;
129
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
//variavel de acesso global que define quando uma ação pode acontecer
if (other.gameObject.tag == "Interagiveis")
interacao = true;
130
if (other.gameObject.tag == "Interagiveis")
interacao = false;
void Update()
if (intervaloInteração == false)
if (interacao == true)
if (Input.GetButtonDown("Interage"))
//está interagindo
131
EstaInteragindo = true;
else
EstaInteragindo = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[RequireComponent(typeof(Collider2D))]
[SerializeField]
if (other.gameObject.tag == "Player")
chamaCena.Invoke();
Movimento2.estaticoGlobal = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Player")
ativaDlg = true;
if (other.gameObject.tag == "Player")
ativaDlg = false;
}
134
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Player")
//ativa componente
_jogador.enabled = true;
if (other.gameObject.tag == "Player")
//desativa componente
_jogador.enabled = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Update()
if(dlg.lineIndex == 4)
//ativa animação
renataAnim.SetBool("DialogEnd", true);
//altera posição
renataPos.Translate(Vector2.left * 5 * Time.deltaTime);
//invoca rotina
StartCoroutine("DestroyR");
//rotina
IEnumerator DestroyR()
//intervalo de tempo
//destroi o objeto
Destroy(renataObj);
using System.Collections;
using System.Collections.Generic;
137
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Player")
//desativa objeto
npc1.SetActive(false);
//ativa objeto
npc2.SetActive(true);
}
138
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//declara componentes
void Update()
if (dlg.lineIndex == 1)
dog.enabled = true;
if(dlg.lineIndex == 2)
//Invoca rotina
StartCoroutine("Stop");
139
//rotina
IEnumerator Stop()
//intervalo de tempo
dog.enabled = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
using UnityEngine.SceneManagement;
{
140
//declara variaveis
[SerializeField]
if(AtivaDialogo.ativaDlg == false)
lineIndex = 0;
audioFala.Stop();
if (fimDialog == true)
dialog.enabled = false;
audioFala.enabled = false;
borda.SetActive(false);
Movimento2.podePular = true;
Movimento2.moveSpeed = 6.5f;
cameraZoom.SetBool("IniciaDialog", false);
if (CompletaObjetivo.tipoDialog == true)
//altera variavel
JogadorInterage.interacao = false;
//Invoca rotina
StartCoroutine("ProximaFase");
142
if (Input.GetButtonDown("Interage"))
if (Pause.isGamePaused == false)
if (fimDialog == false)
if (dialogueText.text == dialogueLines[lineIndex])
//invoca rotina
NextDialogueLine();
else
StopAllCoroutines();
dialogueText.text = dialogueLines[lineIndex];
audioFala.Stop();
}
143
else
StopAllCoroutines();
//invoca rotina
NextDialogueLine();
// Metodo de dialogo
if (!dialogueStart)
if (fimDialog == false)
//altera variaveis
Movimento2.podePular = false;
Movimento2.moveSpeed = 0;
borda.SetActive(false);
dialogueStart = true;
dialoguePanel.SetActive(true);
144
lineIndex = 0;
StartCoroutine("ShowLine");
cameraZoom.SetBool("IniciaDialog", true);
if (fimDialog == false)
lineIndex++;
//se a quantidade de linhas lidas for menor que a quantidade total de linhas
//invoca rotina
StartCoroutine("ShowLine");
//se a a quantidade de linhas lidas for igual que a quantidade total de linhas
else
//altera variaveis
dialogueStart = false;
dialoguePanel.SetActive(false);
borda.SetActive(true);
145
fimDialog = true;
transicao.SetActive(true);
//Rotina
dialogueText.text = string.Empty;
audioFala.Play();
dialogueText.text += ch;
//para o audio
audioFala.Stop();
//Rotina
transicao.SetActive(true);
camera.enabled = false;
CompletaObjetivo.tipoDialog = false;
146
SceneManager.LoadScene(proximaFase);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
if (JogadorInterage._podeAcao == true)
//invoca Rotina
StartCoroutine("Sair");
if (JogadorInterage._podeAcao == true)
//invoca rotina
StartCoroutine("Entrar");
//Rotina
IEnumerator Sair()
//ativa a transição
transicaoAtiva.SetActive(true);
JogadorInterage._podeAcao = false;
fundoCenarioAtiva.SetActive(false);
148
cenario1.SetActive(true);
cenario2.SetActive(false);
//Rotina
IEnumerator Entrar()
//ativa a transição
transicaoAtiva.SetActive(true);
JogadorInterage._podeAcao = false;
fundoCenarioAtiva.SetActive(true);
cenario1.SetActive(false);
cenario2.SetActive(true);
using System.Collections;
using System.Collections.Generic;
149
using UnityEngine;
void Update()
//invoca rotina
StartCoroutine("DesativaTransicao");
//rotina
IEnumerator DesativaTransicao()
//altera variavel
prxTrue = true;
Movimento2.estaticoGlobal = false;
//intervalo de tempo
//altera variaveis
prxTrue = false;
JogadorInterage._podeAcao = true;
150
transicao.SetActive(false);
Movimento2.estaticoGlobal = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if (ativou == false) {
if (other.gameObject.tag == "Player")
// ativa os inimigos
ativaObjetivo.SetActive(true);
inimigos.SetActive(true);
ativou = true;
4.2.6.2 Inimigos
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Start()
fcRight = transform.localScale;
fcLeft = transform.localScale;
void FixedUpdate()
if (EnemyKill == false)
if (movingRight)
//define a direção
transform.localScale = fcRight;
153
//invoca a rotina
StartCoroutine("MovimentLeft");
if (movingRight == false)
//Movimento
//define a direção
transform.localScale = fcLeft;
//invoca a rotina
StartCoroutine("MovimentRight");
IEnumerator MovimentLeft()
//Movimento
movingRight = false;
IEnumerator MovimentRight()
154
movingRight = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//declara variaveis
void Start()
currentHP = enemyHP;
}
155
void Update()
if (currentHP <= 0)
StartCoroutine("Kill");
currentHP -= damage;
//Rotina "kill"
IEnumerator Kill()
//intervalo de tempo
Destroy(transform.parent.gameObject);
}
156
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
if(other.gameObject.tag == "HurtBox")
theRB2D.velocity = Vector2.up * 0;
eliminouInimigoSom.Play();
TextoFlutuante.textAtiva = true;
eliminouInimigoText.SetActive(true);
other.gameObject.GetComponent<EnemyHP>().TakeDamage(damageToDeal);
4.2.6.5 Plataforma
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
{
158
//declara variavel
if (other.gameObject.tag == "plataforma")
gameObject.transform.parent = other.transform;
//detecta contato
colidiu = true;
//se indetificar que não existe mais contato com o Objeto "Plataforma"
if (other.gameObject.tag == "plataforma")
gameObject.transform.parent = null;
//detecta contato
colidiu = false;
}
159
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//declara variaveis
void FixedUpdate()
if (Plataforma)
if (movingRight)
//invoca rotina
160
StartCoroutine("MovimentLeft");
if (movingRight == false)
//altera direção
//invoca rotina
StartCoroutine("MovimentRight");
IEnumerator MovimentLeft()
//altera direção
//intervalo de tempo
//altera variavel
movingRight = false;
IEnumerator MovimentRight()
//intervalo de tempo
161
//altera variavel
movingRight = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//declara variaveis
void FixedUpdate()
if (Plataforma)
if (movingUp)
//invoca rotina
StartCoroutine("Movimentup");
if (movingUp == false)
//altera direção
//invoa rotina
StartCoroutine("Movimentdown");
IEnumerator Movimentup()
//altera direção
//intervalo de tempo
//altera variavel
movingUp = false;
163
IEnumerator Movimentdown()
//intervalo de tempo
//altera variavel
movingUp = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//declara variaveis
void FixedUpdate()
if (EnemyKill == false)
if (movingtop)
//invoca rotina
StartCoroutine("MovimentUp");
if (movingtop == false)
//muda direção
//invoca rotina
StartCoroutine("MovimentDown");
}
165
IEnumerator MovimentUp()
//direção
//intervalo de tempo
movingtop = false;
IEnumerator MovimentDown()
//intervalo de tempo
movingtop = true;
}
166
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
void Update()
objText.text = numObjetivo.ToString();
}
167
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
[SerializeField]
void Start()
Objetivo = GetComponent<CapsuleCollider2D>();
}
168
if (other.gameObject.tag == "Player")
tipoDialog = true;
//ativa o componente
dialog.enabled = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
[RequireComponent(typeof(Collider2D))]
//animação do jogador
//componente de audio
void Update()
170
qtdLinhas = dlgDC.lineIndex;
if(qtdLinhas == 4)
player.transform.Translate(Vector2.left * 5f * Time.deltaTime);
DonaC.SetBool("saindo", true);
plrAnim.SetBool("andando", true);
plrAnim.SetBool("parado", false);
limiteCmr.SetActive(true);
//desativa o campo que impede que o jogador saia pra fora dos limites de visão da
camera
limiteCmr1.SetActive(false);
mov.enabled = false;
StartCoroutine("ProximaFase");
{
171
if (other.gameObject.tag == "Player")
camera.enabled = false;
donaCleusa.SetActive(true);
trilhaSonora.enabled = false;
IEnumerator ProximaFase()
transicao.SetActive(true);
SceneManager.LoadScene(proximaFase);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
172
//invoca metodo
if(BotaoInterage.onOff == false)
//audio inicia
carta.Play();
//animação inicia
_animator.SetBool("pegou", true);
if(BotaoInterage.onOff == true)
//animação para
_animator.SetBool("pegou", false);
}
173
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
[RequireComponent(typeof(Collider2D))]
//animação inicia
_animator.SetBool("pegou", true);
Movimento2.estaticoGlobal = false;
}
174
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//declara variaveis
void Start()
//define variaveis
fcRight = transform.localScale;
fcLeft = transform.localScale;
}
175
void Update()
if (movingUp)
//altera direção
transform.localScale = fcRight;
//invoca rotina
StartCoroutine("MovimentLeft");
if (movingUp == false)
//altera posição
//altera direção
transform.localScale = fcLeft;
//invoca rotina
StartCoroutine("MovimentRight");
//rotina
IEnumerator MovimentLeft()
//altera posição
//intervalo de tempo
//altera variavel
movingUp = false;
//rotina
IEnumerator MovimentRight()
//intervalo de tempo
//altera variavel
movingUp = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
//declara objeto da cena que funciona como um icone pra destacar outro objeto
//variavel de posição
void Start()
podeRecuperar = false;
//invoca rotina
StartCoroutine("RecMarmita");
marmitinha = GetComponent<Rigidbody2D>();
}
178
if (other.gameObject.tag == "Player")
if (podeRecuperar == true)
SetaOff.pegou = true;
MarmitaPos.dropou = false;
PlayerHP.playerhp = 2;
//destroi o objeto
DestroyObj();
PlayerHP.recuperouMarmita = true;
if (other.gameObject.tag == "plataforma")
colidiu = true;
179
borda.SetActive(true);
marmitinha.constraints = RigidbodyConstraints2D.FreezePosition;
if (other.gameObject.tag == "chao")
borda.SetActive(true);
marmitinha.constraints = RigidbodyConstraints2D.FreezePosition;
colidiu = true;
if (other.gameObject.tag == "Paredes")
if (colidiu == false)
marmitinha.constraints = RigidbodyConstraints2D.FreezePositionX;
if (other.gameObject.tag == "MorteQueda")
RespawnMarmita.destroyerMarmita = true;
DestroyObj();
Destroy(marmitaObj);
if (other.gameObject.tag == "chao")
marmitinha.constraints = ~RigidbodyConstraints2D.FreezePosition;
colidiu = false;
IEnumerator RecMarmita()
podeRecuperar = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Update()
//define que a posição da marmita ao ser instanciada na cena será sempre igual a
posição do jogador
if(PlayerHP.playerhp == 1)
if (dropou == false)
Instantiate(marmita, spawnerMarmita.transform.position,
this.gameObject.transform.rotation);
dropou = true;
//ativa o componente na cena que impede que o jogador prossiga sem recuperar o
objeto
182
limiteMapa.SetActive(true);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Update()
//se o objeto "marmita" for destruido por motivos exteriores (cair no limbo)
if (destroyerMarmita == true)
seta.SetActive(true);
Instantiate(marmita, spawnerMarmita.transform.position,
this.gameObject.transform.rotation);
destroyerMarmita = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if(pegou == false)
//ativa limite de cenário que impede do Jogador chegar ao objetivo sem a marmita
parede.SetActive(true);
if(pegou == true)
parede.SetActive(false);
if (other.gameObject.tag == "Player")
//se a marmita não tiver sido recuperada e já estiver no campo de visão da camera
if (RespawnMarmita.destroyerMarmita == true)
seta.SetActive(false);
}
185
if (other.gameObject.tag == "Player")
if (RespawnMarmita.destroyerMarmita == true)
if (pegou == false)
seta.SetActive(true);
using System.Collections;
using System.Collections.Generic;
186
using UnityEngine;
//define quando a camera deve parar de seguir o personagem (paredes e limites de cenário)
[RequireComponent(typeof(Collider2D))]
//declara objeto
void Update()
if (SetaOff.pegou == true)
seta.SetActive(false);
if (other.gameObject.tag == "Marmita")
seta.SetActive(true);
SetaOff.pegou = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Marmita")
seta1.SetActive(false);
seta2.SetActive(false);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
int numeroBack = 3;
//metódo Update
void Update()
//se o personagem estiver em movimento e não estiver colidindo com nenhum objeto
if (Movimento2.bGround == true)
if (Input.GetAxis("Horizontal") > 0)
movEsq = true;
movDir = false;
if (movEsq == true)
if (Input.GetAxis("Horizontal") < 0)
movDir = true;
movEsq = false;
if (movDir == true)
if (Movimento2.bGround == false)
movDir = false;
movEsq = false;
if (other.gameObject.tag == "LimiteFundo")
GetComponent<BoxCollider2D>().transform.position = posicao;
if (other.gameObject.tag == "LimiteFundo-x")
191
GetComponent<BoxCollider2D>().transform.position = posicao2;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Player")
//para a camera
FollowCamera.stpCmrCenario = true;
192
if (other.gameObject.tag == "Player")
FollowCamera.stpCmrCenario = false;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
{
193
//Se o personagem "cair" no limbo da cena a camera irá parar de seguir com base nos
limites de cenario
if (other.gameObject.tag == "Player")
FollowCamera1.perdeuQueda = true;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//criando variaveis
void Start()
stpCamera = false;
stpCmrCenario = false;
void FixedUpdate()
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Start()
introNgStart.SetBool("IntroStart", true);
StartCoroutine("ExcluirIntro");
Movimento2.estaticoGlobal = false;
IEnumerator ExcluirIntro()
Movimento2.estaticoGlobal = true;
Destroy(introObj);
using System.Collections;
196
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
//declara variaveis
void Start()
StartCoroutine("ProximaFase");
IEnumerator ProximaFase()
trilhaSonora.enabled = false;
somAmbiente.enabled = false;
Movimento2.podePular = false;
Movimento2.moveSpeed = 0;
SceneManager.LoadScene(proximaFase);
197
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Start()
//Sempre que o jogador começar uma nova fase, váriaveis globais são
alteradas para seus valores iniciais
TrilhasSonoras.falouDnCleusa = false;
JogadorInterage.interacao = false;
CompletaObjetivo.tipoDialog = false;
BotaoInterage.onOff = false;
Movimento2.podePular = true;
Movimento2.moveSpeed = 6.5f;
198
Movimento2.estaticoGlobal = true;
MarmitaPos.dropou = false;
SetaOff.pegou = true;
FollowCamera1.perdeuQueda = false;
Pause.isGamePaused = false;
Desativatransicao.prxTrue = false;
SaveFaseCarregar.fase = 1;
//Componente do próprio Unity que cria um arquivo local com uma Variavel
do tipo inteira
PlayerPrefs.SetInt("dbFase", SaveFaseCarregar.fase);
SaveFaseCarregar.fase = 2;
PlayerPrefs.SetInt("dbFase", SaveFaseCarregar.fase);
SaveFaseCarregar.fase = 3;
PlayerPrefs.SetInt("dbFase", SaveFaseCarregar.fase);
SaveFaseCarregar.fase = 4;
PlayerPrefs.SetInt("dbFase", SaveFaseCarregar.fase);
SaveFaseCarregar.fase = 5;
PlayerPrefs.SetInt("dbFase", SaveFaseCarregar.fase);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Audio;
Screen.fullScreen = isFullscreen;
if (som == true)
armazenaVolume = volume;
mainMixer.SetFloat("volume", volume);
//Código cria o botão “float” que regula (aumenta e diminui) o som, a variável criada pela
regulagem é armazenada\\
som = setSound;
if (som == false)
mainMixer.SetFloat("volume", -80);
}
201
//Código faz com que quando botão do som esteja desativado não será possível regular o
volume\\
void Update()
if (som == true)
SetVolume(armazenaVolume);
slider.value = armazenaVolume;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//invocada apenas uma vez no primeiro momento que o objeto for ativado
void Start()
bene.transform.position = posicao.transform.position;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
void Start()
if (PlayerPrefs.HasKey("dbFase"))
fase = PlayerPrefs.GetInt("dbFase");
else
fase = 0;
//Código presente para gerar o armazenamento das fases alcançadas e as tornar jogáveis e
selecionáveis\\
void update()
if(fase == 1)
botao2.SetActive(true);
if(fase == 2)
botao3.SetActive(true);
if(fase == 3)
botao4.SetActive(true);
204
if(fase == 4)
botao5.SetActive(true);
if(fase == 5)
botao6.SetActive(true);
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
SceneManager.LoadScene (name);
Application.Quit ();
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
//define que número de fases desbloqueadas é zero, todo o progresso (caso tenha) é
perdido
SaveFaseCarregar.fase = 0;
PlayerPrefs.SetInt("dbFase", SaveFaseCarregar.fase);
using System.Collections;
206
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Player")
StartCoroutine("ProximaFase");
IEnumerator ProximaFase()
{
207
transicao.SetActive(true);
camera.enabled = false;
SceneManager.LoadScene(proximaFase);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
//declara variaveis
{
208
if (other.gameObject.tag == "Bar")
somBar.Play();
somFora.Pause();
somFora1.Stop();
if (other.gameObject.tag == "Bar")
if (falouDnCleusa == true)
somBar.Stop();
somFora1.Play();
else
somBar.Stop();
somFora.Play();
}
209
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[RequireComponent(typeof(Collider2D))]
if (other.gameObject.tag == "Bar")
seta.SetActive(false);
if (other.gameObject.tag == "Bar")
{
210
if (TrilhasSonoras.falouDnCleusa == true)
seta.SetActive(true);
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
SceneManager.LoadScene (name);
Time.timeScale = 1f;
Application.Quit ();
}
211
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
void Update()
if (Input.GetKeyDown(KeyCode.Escape))
if (PlayerHP.playerhp != 0)
if (isGamePaused)
ResumeGame();
}
212
else
PauseGame();
//quando a tecla “esc” for pressionada, PauseGame se tornará real e ao ser pressionada
novamente se tornara falso e ResumeGame se tornara real\\
PauseMenu.SetActive(false);
Time.timeScale = 1f;
cameraSom.enabled = true;
isGamePaused = false;
//quando tecla “esc” for pressionada com PauseGame ativo ou o botão de resumo for
selecionado, ResumeGame se torna real e jogo volta ao normal\\
void PauseGame()
PauseMenu.SetActive(true);
Time.timeScale = 0f;
cameraSom.enabled = false;
isGamePaused = true;
cameraSom.enabled = true;
Time.timeScale = 1f;
isGamePaused = false;
SceneManager.LoadScene (name);
//quando botão de voltar ao menu for selecionado ele se torna real, tempo de jogo normal,
som ativo, é carregada a cena do menu. Mesmo código é usado para quando a tecla
recomeçar é selecionada e a cena do nível que foi salva pela última vez é carregado\\
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
void Update()
if (Input.GetKeyDown(KeyCode.Escape))
{
214
SceneManager.LoadScene (0);
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
menuOpc.SetActive(true);
menuOpc.SetActive(false);
}
215
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
//tela de transição
void Update()
if (Input.GetKey(KeyCode.E))
if (Desativatransicao.prxTrue == false)
//ativa transicao
transicao.SetActive(true);
//invoca Rotina
StartCoroutine("Transicion");
if(txtactive == 1)
txt.SetActive(true);
if (txtactive == 2)
txt1.SetActive(true);
if (txtactive == 3)
txt2.SetActive(true);
217
if (txtactive == 4)
txt3.SetActive(true);
if (txtactive == 5)
SceneManager.LoadScene(prxFase);
//rotina
IEnumerator Transicion()
//intervalo de tempo
txtactive++;
//para a rotina
StopCoroutine("Transicion");
}
218
5. PLANO DE NEGÓCIOS
5.2 Swot
6. MANUAL DO USUÁRIO
6.1.2 Desenvolvedores
6.1.3 Personagens
6.1.5 Contato
Figura 35 - Download
6.1.2 Opções
Figura 42 - Opções
6.1.3 Jogo
Figura 43 - Tutorial
Figura 44 - Carta
Carta da mãe de Benedito, ao clicar no botão “E” o jogador irá interagir com o
cenário.
235
Figura 48 - Interação
Figura 49 - Missão
Figura 50 - Inimigos
Figura 51 - Marmita
Figura 52 - Diálogo
Figura 53 - Plataformas
Figura 57 - Créditos
7. HORAS TRABALHADAS
Software Licença
Aseprite R$ 37,99
Canvas R$ 449,00/ano
Draw.io Gratuito
Git Gratuito
Heroku Gratuito
Unity 5 Gratuito
Lucas Stampini
Programador R$ 7,50 850 h R$ 6.375
Yokoyama
8. CONCLUSÃO
9. REFERÊNCIAS BIBLIOGRÁFICAS
HANASHIRO, Akira. VS Code - O que é e por que você deve usar? Treinaweb.
Disponível em: https://www.treinaweb.com.br/blog/vs-code-o-que-e-e-por-que-voce-
deve-
usar#:~:text=O%20Visual%20Studio%20Code%20(VS,com%20HTML,%20CSS%20
e%20JavaScript. Acesso em: 16 nov. 2022.
FERREIRA, Hélder. Draw.IO - Desenhar diagramas nunca foi tão fácil - Pplware.
Pplware. Disponível em: https://pplware.sapo.pt/internet/draw-io-desenhar-
diagramas-nunca-foi-tao-facil/. Acesso em: 16 nov. 2022.
L, Andrei. O que é HTML? Guia Completo com Lista de Comandos Básicos HTML.
Hostinger. Disponível em: https://www.hostinger.com.br/tutoriais/o-que-e-html-
conceitos-basicos. Acesso em: 17 nov. 2022.
OKUBO, Beatriz. Você Sabe o que é CSS? Entenda Como Funciona e Para que
Serve. GoDaddy. Disponível em: https://br.godaddy.com/blog/voce-sabe-o-que-e-
css-entenda-como-funciona-e-para-que-serve/. Acesso em: 16 nov. 2022.
10. ANEXOS
Assunto / tema:
VS Code - O que é e por que você deve usar?
Referência bibliográfica: (conforme Norma ABNT)
HANASHIRO, Akira. VS Code - O que é e por que você deve usar? Treinaweb.
Disponível em: https://www.treinaweb.com.br/blog/vs-code-o-que-e-e-por-que-
voce-deve-
usar#:~:text=O%20Visual%20Studio%20Code%20(VS,com%20HTML,%20CSS%
20e%20JavaScript. Acesso em: 16 nov. 2022.
A princípio ele é uma ferramenta muito simples, mas ele possui uma loja de
extensões imensa, e que continua crescendo.
Local:
https://unity.com/pt
257
Local:
https://pplware.sapo.pt/internet/draw-io-desenhar-diagramas-nunca-foi-tao-facil/
258
Local:
https://www.microlins.com.br/blog/tecnologia/pacote-office-–-o-que-e-e-quais-as-
principais-funcoes-de-cada-programa/
259