Hey todo llega a su final y este curso no es la excepción, y como proyecto final creamos una copia del famoso juego de Atari Mars Invaders!!
lo hicimos entre Miguel Briseño, Alan Martinez y yo, Guillermo Serrano.
fue un proyecto complejo pero divertido en el que aprendimos muchas cosas muy importantes.
pero aquí tenemos un vídeo de como funciona: https://youtu.be/wCx3FjJlTEA
y nuestro hermoso codigo:
#include<stdio.h>
#include <windows.h>
#include <conio.h>
#include<cstdlib>
#define arriba 72
#define abajo 80
#define derecha 77
#define izquierda 75
#include <list>
using namespace std;
void posicion(int x,int y){
HANDLE hCon; //con esta fncion se definen los
hCon = GetStdHandle(STD_OUTPUT_HANDLE); //valores de las coordenadas para que los
COORD dwPos; //objetos se desplacen por la pantalla
dwPos.X= x;
dwPos.Y = y;
SetConsoleCursorPosition(hCon,dwPos);
}
void ocultar(){
HANDLE hCon;
hCon = GetStdHandle(STD_OUTPUT_HANDLE);
CONSOLE_CURSOR_INFO cur;
cur.dwSize = 50;
cur.bVisible = FALSE;
SetConsoleCursorInfo(hCon,&cur);
}
void limites (){
for (int i = 1 ; i<= 78; i++){ // en esta funcion se declaran los movimientos
posicion(i,3); // y los limites en los ejes “x” y “y”
printf (“%c”,240); // el numero 240 es el codigo ascii para el caracter “-”
} // al igual que el 219 para el caracter “█” que es un cuadro
for (int i = 1 ; i<= 78; i++){ // para dibujar los limites de donde se va a jugar.
posicion(i,34); // se llama a la funcion posicion () para dar las posiciones en la pantalla
printf (“%c”,240);
}
for (int i = 4 ; i<= 33; i++){
posicion(1,i);
printf (“%c”,219);
}
for (int i = 4 ; i<= 33; i++){
posicion(78,i);
printf (“%c”,219);
}
}
class NAVE{
public: int x,y,cor,vidas;
public :
NAVE(int _x,int _y,int _cor,int _vidas):x(_x), y(_y),cor(_cor),vidas(_vidas){}
int X (){return x;}
int Y (){return y;}
void dibujar();
void
Continue reading “PROYECTO FINAL!!” →