Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • nave8/jogo-final
  • emo3/jogo-final
  • amol/jogo-final
3 results
Show changes
Commits on Source (4)
No preview for this file type
Para rodar o jogo, execute o shell script ./build.sh, caso esteja no windows, utilize o git bash para executar o shell script.
repositorio git do projeto: http://gitcin.cin.ufpe.br/nave8/jogo-final/
Creditos pelo todo codigo: Ana sofia, Caio Leitao, e Lucas Alves.
\ No newline at end of file
No preview for this file type
File added
No preview for this file type
......@@ -337,7 +337,7 @@ void secondLevel() {
y_fundo = -1 * fundo_fase1.height + 600;
InitAudioDevice();
som_coleta_moeda = LoadSound("assets/som_mario.mp3");
while (!WindowShouldClose()) {
......@@ -439,7 +439,7 @@ void secondLevel() {
printf("Memória liberada com sucesso.\n");
CloseAudioDevice();
}
......@@ -510,7 +510,7 @@ void firstLevel() {
y_fundo = -1 * fundo_fase1.height + 600;
InitAudioDevice();
som_coleta_moeda = LoadSound("assets/som_mario.mp3");
while (!WindowShouldClose()) {
......@@ -581,18 +581,18 @@ void firstLevel() {
sprintf(mostrarMoedas, "Seus pontos: $%d", contador);
Vector2 moedasTela = {SCREEN_WIDTH - MeasureText(mostrarMoedas, 20) - 75, SCREEN_HEIGHT - 40};
DrawTextEx(joystix, mostrarMoedas, moedasTela, 20, 0, WHITE);
if(contador < 250){
if(contador < 300){
Vector2 conversaJogador = {0,0};
DrawTextEx(joystix, "Voce precisa pegar 250 pontos para ir a proxima fase\n", conversaJogador, 20, 0, WHITE);
DrawTextEx(joystix, "Voce precisa pegar 300 pontos para ir a proxima fase\n", conversaJogador, 20, 0, WHITE);
} else {
Vector2 conversaJogador = {0,0};
DrawTextEx(joystix, "Parabens, voce conseguiu 250 pontos!\nagora, voce vai para a proxima fase :D", conversaJogador, 20, 0, WHITE);
DrawTextEx(joystix, "Parabens, voce conseguiu 300 pontos!\nagora, voce vai para a proxima fase :D", conversaJogador, 20, 0, WHITE);
}
EndDrawing();
if (contador >= 250){ //chegar a 30 moedas vai pra a proxima fase ... o espaco
if (contador >= 300){ //chegar a 30 moedas vai pra a proxima fase ... o espaco
UnloadTexture(personagem.texture);
UnloadTexture(fundo_fase1);
......@@ -646,7 +646,7 @@ void firstLevel() {
printf("Memória liberada com sucesso.\n");
CloseAudioDevice();
......
#include "menu.h"
#include "stdio.h"
void creditos(){
// Incializações
Font joystix = LoadFont("assets/joystix.otf");
int selectedOption = 0;
Image backgroundImage = LoadImage("assets/background_espaco.png");
ImageResize(&backgroundImage, SCREEN_WIDTH, SCREEN_HEIGHT);
Texture2D backgroundTexture = LoadTextureFromImage(backgroundImage);
UnloadImage(backgroundImage);
Vector2 titlePosition = { (SCREEN_WIDTH - MeasureText("INSTRUCOES", 30))/2, 70 + 2 };
Vector2 mostrarCreditos = {SCREEN_WIDTH/2 -100,SCREEN_HEIGHT/2 - 20};
Vector2 mostrarEsc = {40, SCREEN_HEIGHT - 40};
while (!WindowShouldClose()) {
BeginDrawing();
ClearBackground(BLACK);
DrawTexture(backgroundTexture, 0,0, WHITE);
DrawTextEx(joystix, "INSTRUCOES", titlePosition, 30, 0, WHITE);
DrawTextEx(joystix ,"Ana sofia\nLucas Alves\nCaio Leitao\n", mostrarCreditos, 20, 0, WHITE);
DrawTextEx(joystix, "Digite TAB para voltar", mostrarEsc, 20, 0, WHITE);
EndDrawing();
if(IsKeyPressed(KEY_TAB)){
menu();
}
}
}
void instrucoes() {
// Incializações
Font joystix = LoadFont("assets/joystix.otf");
......@@ -52,7 +93,7 @@ void instrucoes() {
DrawTextEx(joystix ,"para movimentar\nseu personagem", mostrarInstrucoes2, 20, 0, WHITE);
DrawTextEx(joystix ,"Seu objetivo e subir o mapa\ne conseguir o maximo de moedinhas\nque puder, com os pontos voce\npodera comprar os personagens.\n\nSe voce cair fora das plataformas\nvoce perde o jogo X_X", mostrarInstrucoes3, 20, 0, WHITE);
DrawTextEx(joystix ,"Seu objetivo e subir o mapa\ne conseguir o maximo de moedinhas\nque puder, com os pontos voce\npodera comprar os personagens.\n\nSe voce cair fora das plataformas\nvoce perde o jogo X_X\n", mostrarInstrucoes3, 20, 0, WHITE);
DrawTextEx(joystix, mostrarMoedas, moedasTela, 20, 0, WHITE);
......@@ -101,24 +142,24 @@ void shopping() {
ImageResize(&personagemImage1, 100, 100);
Texture2D personagemTexture1 = LoadTextureFromImage(personagemImage1);
UnloadImage(personagemImage1);
Vector2 mostrarPersonagem1 = {rectX[0], SCREEN_HEIGHT/2 - 120, WHITE};
Vector2 mostrarStatusPersonagem1 = {rectX[0], SCREEN_HEIGHT/2 + 120, WHITE};
Vector2 mostrarPersonagem1 = {rectX[0], SCREEN_HEIGHT/2 - 120};
Vector2 mostrarStatusPersonagem1 = {rectX[0], SCREEN_HEIGHT/2 + 120};
Image personagemImage2 = LoadImage("assets/cat.png");
ImageResize(&personagemImage2, 100, 100);
Texture2D personagemTexture2 = LoadTextureFromImage(personagemImage2);
UnloadImage(personagemImage2);
Vector2 mostrarPersonagem2 = {rectX[1], SCREEN_HEIGHT/2 - 120, WHITE};
Vector2 mostrarStatusPersonagem2 = {rectX[1], SCREEN_HEIGHT/2 + 120, WHITE};
Vector2 mostrarPersonagem2 = {rectX[1], SCREEN_HEIGHT/2 - 120};
Vector2 mostrarStatusPersonagem2 = {rectX[1], SCREEN_HEIGHT/2 + 120};
Image personagemImage3 = LoadImage("assets/edna.png");
ImageResize(&personagemImage3, 100, 100);
Texture2D personagemTexture3 = LoadTextureFromImage(personagemImage3);
UnloadImage(personagemImage3);
Vector2 mostrarPersonagem3 = {rectX[2], SCREEN_HEIGHT/2 - 120, WHITE};
Vector2 mostrarStatusPersonagem3 = {rectX[2], SCREEN_HEIGHT/2 + 120, WHITE};
Vector2 mostrarPersonagem3 = {rectX[2], SCREEN_HEIGHT/2 - 120};
Vector2 mostrarStatusPersonagem3 = {rectX[2], SCREEN_HEIGHT/2 + 120};
......@@ -187,7 +228,7 @@ void menu() {
enum { PLAY, SHOPPING, INSTRUCOES, CONFIGURACOES, EXIT };
enum { PLAY, SHOPPING, INSTRUCOES, CONFIGURACOES, CREDITOS, EXIT };
int selectedOption = 0;
// Load do background
Image backgroundImage = LoadImage("assets/background_espaco.png");
......@@ -201,9 +242,9 @@ void menu() {
Vector2 titlePositionSombra = { (SCREEN_WIDTH - MeasureText("CINTERGALATICO", 40))/2, 70 + 2 };
int rectX = (SCREEN_WIDTH - 300) / 2; // Posição X do retângulo
int rectY = (SCREEN_HEIGHT - (4 * 40)) / 2; // Posição Y do retângulo
int rectY = (SCREEN_HEIGHT - (5 * 40)) / 2; // Posição Y do retângulo
int rectWidth = 300; // Largura do retângulo
int rectHeight = 4 * 40; // Altura do retângulo (5 opções)
int rectHeight = 5 * 40; // Altura do retângulo (5 opções)
char mostrarMoedas[20];
sprintf(mostrarMoedas, "Seus pontos: $%d", moedas);
......@@ -236,9 +277,9 @@ void menu() {
DrawRectangleLines(rectX, rectY, rectWidth, rectHeight, RED);
// Itens do menu
char *menuItems[] = { "INICIAR JOGO", "SHOPPING DO CIN", "INSTRUCOES", "SAIR" };
char *menuItems[] = { "INICIAR JOGO", "SHOPPING DO CIN", "INSTRUCOES", "CREDITOS", "SAIR" };
for (int i = 0; i < 4; i++) {
for (int i = 0; i < 5; i++) {
Vector2 itemPosition = { SCREEN_WIDTH/2 - 120, rectY + 10 + i * 40 };
Color textColor = i == selectedOption ? RED : WHITE;
DrawTextEx(joystix, menuItems[i], itemPosition, 20, 2, textColor);
......@@ -259,6 +300,8 @@ void menu() {
shopping();
} else if(selectedOption == 2){
instrucoes();
} else if(selectedOption == 3){
creditos();
} else {
CloseWindow();
}
......
......@@ -10,6 +10,7 @@
int main(void) {
// Inicializar a janela
InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "CINTERGALÁTICO");
InitAudioDevice();
SetTargetFPS(60);
// Inicializar o jogo
......@@ -20,6 +21,6 @@ int main(void) {
}
// Fechar a janela
CloseAudioDevice();
return 0;
}