ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Juego en c++ creado por mi


Enviado por   •  9 de Febrero de 2016  •  Trabajos  •  1.464 Palabras (6 Páginas)  •  280 Visitas

Página 1 de 6

//Osvcar es el mas guapo del salon y gracias a el acabamos

#include <iostream>

#include <conio.h>

#include <windows.h>

#include <stdlib.h>

#define ARRIBA 72

#define IZQUIERDA 75

#define DERECHA 77

#define ABAJO 80

int arr[1];

int puntos[6];

int score = 0;

char tecla;

int v=5, i = -1, h = -1;

bool game_over;

bool fin = false;

int nombre [4];

using namespace std;

string name [6];

int arrs [6];

int altscore;

int aaa = 1;

int j;

char arrc [6];

void gotoxy (int x,int y){

HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);

COORD dwPos;

dwPos.X = x;

dwPos.Y = y;

SetConsoleCursorPosition(hcon,dwPos);

}

void tiempo (){

arr[5] ++;

if (arr [5] == 9){

arr [4] ++;

arr [5] = 0;

}

if (arr [4] == 7) {

arr [3] ++;

score ++;

arr [4] = 0;

arr [5] = 0;

}

if (arr [3] > 9){

arr [2]++;

arr [3] = 0;

}

if (arr [2] == 6 && arr [3] == 0){

arr [1] ++;

arr [3] = 0;

arr [2] = 0;

}

if (arr [1] > 9){

arr [0] ++;

arr [1] = 0;

}

if (arr [0] == 6 && arr [1] == 0){

game_over = true;

}

gotoxy (1,1);

cout << "Tiempo jugado: " << arr [0] << arr [1] << ":"<< arr [2] << arr [3];

gotoxy (1,2); cout << "Score: " << score;

}

void margen(){

for(int i=3;i<50;i++){

gotoxy(15,i);

printf("%c",178);

}

for(int i=3;i<50;i++){

gotoxy(50,i);

printf("%c",178);

}

}

class personage{

public:

int x,y;

personage(int _x,int _y);

void dibujar();

void controlar();

void borrar();

void vidas();

};

personage::personage(int _x,int _y){

x = _x;

y = _y;

}

void personage::dibujar(){

gotoxy(x,y);printf (" %c%c%c%c%c",30,254,254,254,30);

gotoxy(x,y+1);printf("%c%c%c%c%c%c%c",219,254,254,254,254,254,219);

gotoxy(x,y+2);printf(" %c%c%c%c%c",254,254,254,254,254);

gotoxy(x,y+3);printf(" %c%c%c%c%c",254,254,254,254,254);

gotoxy(x,y+4);printf(" %c%c%c%c%c",254,254,254,254,254);

gotoxy(x,y+5);printf("%c%c%c%c%c%c%c",219,254,254,254,254,254,219);

...

Descargar como (para miembros actualizados)  txt (6.1 Kb)   pdf (71.6 Kb)   docx (13.4 Kb)  
Leer 5 páginas más »
Disponible sólo en Clubensayos.com