Programacion

Codigo fuente y otras cosas relacionadas con la programacion:





Presenta:
Boomer Cube

Este videojuego es una variante del clásico Arkanoid, la idea del juego es hacer rebotar la pelota hasta que todos los bloques hallan sido destruidos. El juego consiste de 3 rondas de 5 niveles, a medida que se ganan las rondas la dificultad aumenta considerablemente.
El juego fue desarrollado por Daniel Nicolas Kundro (Danik 3D Studios).
Que lo disfruten!!!

Link de la version para PChttp://www.megaupload.com/?d=40NN9QWX
(el link también se encuentra en la sección de descargas)

Licencia de Creative Commons
Boomer Cube by Daniel Nicolas Kundro is licensed under a Creative Commons Reconocimiento-NoComercial-SinObraDerivada 3.0 Unported License.

Les dejo algunas imágenes del juego terminado:






Les dejo algunas imágenes del proceso de diseño y creación:















//CODIGO FUENTE DESARROLLADO POR DANIEL KUNDRO (Danik 3D)
//Lenguaje: C++ (CPP).
//El Programa tiene 8 funciones:
//1.Agregar Plato
//2.Agregar Ingrediente
//3.Agregar Ingredientes a un Plato
//4.Listar Platos
//5.Listar Ingredientes
//6.Listar Ingredientes de un Plato
//7.Modificar Ingrediente
//8.Mostrar costo de un plato



#include <iostream>
using namespace std;


//ESTRUCTURAS


struct plato{
string nombre;
};


struct ingrediente{
    string nombre;
    double costo;
    double stock;
};


struct platoingrediente{
int plato;
int ingrediente;
double cantidad;
};


//FUNCIONES


int menu();
void agrplato(struct plato[],int &);//AGREGA UN PLATO A LA BDD
void agringr(struct ingrediente [],int &);//AGREGA UN INGREDIENTE A LA BDD
void agreingrplat(struct platoingrediente [],int &,int,int);//AGREGA INGREDIENTE A UN PLATO
void listplat(struct plato[],int);//MUESTRA TODOS LOS PLATOS
void listingr(struct ingrediente[],int);//MUESTRA TODOS LOS INGREDIENTES
void listingrplat(struct platoingrediente[],struct ingrediente ingr[],struct plato[],int,int);//MUESTRA LOS INGREDIENTES DE UN PLATO
int buscarplatos(string,struct plato[],int);//BUSCA UN PLATO EN LA BDD Y DEVUELVE LA ID , EN CASO DE ENCONTRARLA
void modifingr(struct ingrediente[],int);//MODIFICA UN INGREDIENTE
int buscaridingr(string,struct ingrediente [],int);//BUSCA UN INGREDIENTE
void vercosto(struct ingrediente[],struct platoingrediente [],struct plato [],int,int);//MUESTRA EL COSTO DE UN PLATO


///////////


int main()
{
    int op=0;
    struct platoingrediente pci[1000];//BDD DE PLATOS CON INGREDIENTES
    struct plato platos[1000];//BDD DE PLATOS
    struct ingrediente ingrs[1000];//BDD DE INGREDIENTES
    int cantp=0;//contador de platos en la BDD
    int canti=0;//contador de ingredientes en la BDD
    int cantpci=0;//PCI=plato con ingrediente
    while(1)
    {
        op=menu();
        switch(op)
        {
             case 1:
             agrplato(platos,cantp);//Ejecuta la funcion para agregar platos
             break;     
             case 2:
             agringr(ingrs,canti);//Ejecuta la funcion para agregar ingredientes
             break;
             case 3:
             agreingrplat(pci,cantpci,cantp,canti);//Ejecuta la funcion para agregar un ingrediente a un plato
             break;
             case 4:
             listplat(platos,cantp);//Ejecuta la funcion que muestra todos los platos
             break;
             case 5:
             listingr(ingrs,canti);//Ejecuta la funcion que muestra todos los ingredientes
             break;
             case 6:
             listingrplat(pci,ingrs,platos,cantpci,cantp);//Ejecuta la funcion que muestra todos los ingredientes de un plato     
             break;
             case 7:
             modifingr(ingrs,canti);//Ejecuta la funcion que modifica un ingrediente
             break;
             case 8:
             vercosto(ingrs,pci,platos,cantpci,cantp);//Ejecuta la funcion que muestra el costo de un plato
             break;
             case 9:
             return 1;
             break;     
        }
    }
    system("pause");
    return 1;
}


int menu() // MUESTRA EL MENU
{
    int op;
    cout<<"1.Agregar Plato"<<endl;
    cout<<"2.Agregar Ingrediente"<<endl;
    cout<<"3.Agregar Ingredientes a un Plato"<<endl;
    cout<<"4.Listar Platos"<<endl;
    cout<<"5.Listar Ingredientes"<<endl;
    cout<<"6.Listar Ingredientes de un Plato"<<endl;
    cout<<"7.Modificar Ingrediente"<<endl;
    cout<<"8.Mostrar costo de un plato"<<endl;
    cout<<"9.Salir"<<endl;
    cin>>op;
    return op;
}


void agrplato(struct plato platos[],int &cantp )//AGREGA UN PLATO A LA BDD
{
    int t=0;
    cout<<"Agregar Plato:"<<endl<<endl;
    cout<<"Ingrese nombre del plato:";
    cin>>platos[cantp].nombre;
    t=buscarplatos(platos[cantp].nombre,platos,cantp);
    if(t==-1)
    {
        cantp++;
        cout<<"Plato agregado"<<endl;
    }
    else
    {
        cout<<"Existe"<<endl;
    }
    system("pause");
    system("cls");
}


void agringr(struct ingrediente ingr[],int &canti)//AGREGA UN INGREDIENTE A LA BDD
{
    int t=0;
    cout<<"Agregar Ingrediente:"<<endl<<endl;     
    cout<<"Ingrese nombre:";
    cin>>ingr[canti].nombre;
    t=buscaridingr(ingr[canti].nombre,ingr,canti);
    if(t==-1)
    {
        cout<<"Ingrese costo:";
        cin>>ingr[canti].costo;
        cout<<"Ingrese stock:";
        cin>>ingr[canti].stock;
        canti++;
        cout<<"Ingrediente agregado"<<endl;
    }
    else
    {
        cout<<"Existe"<<endl;    
    }
    system("pause");
    system("cls");     
}


void agreingrplat(struct platoingrediente pci[],int &cantpci,int cantp,int canti)//AGREGA UN INGREDIENTE A UN PLATO
{
    int IDp=-1;
    int IDi=-1;
    cout<<"Asignar Ingrediente A Un Plato:"<<endl<<endl;     
    cout<<"Ingrese ID del plato:";
    cin>>IDp;
    if(IDp>cantp-1)
    {
        cout<<"ID invalido, operacion cancelada"<<endl;            
    }
    else
    {
        pci[cantpci].plato=IDp;
        cout<<"Ingrese ID del ingrediente a asignar:";
        cin>>IDi;
        if(IDi>canti-1)
        {
             cout<<"ID invalido, operacion cancelada"<<endl;             
        }
        else
        {
            pci[cantpci].ingrediente=IDi;
            cout<<"Ingrese cantidad:";
            cin>>pci[cantpci].cantidad;
            cantpci++;
            cout<<"Ingrediente asignado"<<endl;
        }
    }
    system("pause");
    system("cls");                      
}


void listplat(struct plato platos[],int cantp)//LISTA PLATOS
{
    int i;
    for(i=0;i<cantp;i++)
    {
        cout<<"Plato:"<<platos[i].nombre<<endl;                  
    }     
    system("pause");
    system("cls");
}


void listingr(struct ingrediente ingr[],int canti)//LISTA INGREDIENTES
{
    int i;
    for(i=0;i<canti;i++)
    {
        cout<<"Ingrediente:"<<ingr[i].nombre<<endl;                  
    }   
    system("pause");
    system("cls");   
}


void listingrplat(struct platoingrediente pci[],struct ingrediente ingr[],struct plato platos[],int cantpci,int cantp)//LISTA INGREDIENTES DE UN PLATO
{
    int ID; 
    int i;
    int j=0;  
    string codigo;
    cout<<"Ingrese nombre:"<<endl;
    cin>>codigo;
    ID=buscarplatos(codigo,platos,cantp);
    if(ID==-1)
    {
        cout<<"No existe"<<endl;
    }
    else
    {
        for(i=0;i<cantpci;i++)
        {
             if(ID==pci[i].plato)
             {
                  cout<<"Ingredientes del plato elegido:"<<ingr[pci[i].ingrediente].nombre<<endl;                 
             }             
        }   
    }
    system("pause");
    system("cls");
}


int buscarplatos(string codigo,struct plato platos[],int cantp)//BUSCA UN PLATO SI LO ENCUENTRA DEVUELVE ID , SINO -1
{
    int t;
    for(t=0;t<cantp;t++)
    {
        if(platos[t].nombre==codigo)
        {
             return t;                      
        }            
    }
    return -1;
}


int buscaridingr(string codigo,struct ingrediente ingr[],int canti)//BUSCA UN INGREDIENTE SI LO ENCUENTRA DEVUELVE ID , SINO -1
{
    int t;
    for(t=0;t<canti;t++)
    {
        if(ingr[t].nombre==codigo)
        {
             return t;                      
        }            
    }
    return -1;
}


void vercosto(struct ingrediente ingr[],struct platoingrediente pci[],struct plato platos[],int cantpci,int cantp)//MUESTRA COSTO DE UN PLATO
{
    int ID; 
    int i;
    int j=0;
    string codigo;
    cout<<"Ingrese Nombre del Plato:"<<endl;
    cin>>codigo;
    ID=buscarplatos(codigo,platos,cantp);
    if(ID==-1)
    {
        cout<<"No existe..."<<endl;          
    }
    else
    {
        double costo=0;                  
        for(i=0;i<cantpci;i++)
        {
             if(ID==pci[i].plato)
             {
             costo+=pci[i].cantidad*ingr[pci[i].ingrediente].costo;         
             }             
        }
    cout<<"Costo del plato:"<<costo<<endl;
    }      
    system("pause");
    system("cls");
}


void modifingr(struct ingrediente ingr[],int canti)//MODIFICAR INGREDIENTE
{
    int ID=0;
    int t=0;
    string codigo;
    cout<<"Ingrese nombre del ingrediente:"<<endl;
    cin>>codigo;
    ID=buscaridingr(codigo,ingr,canti);
    if(ID!=-1)
    {
          cout<<"Modificando Ingrediente"<<endl;       
          cout<<"Ingrese nuevo costo:";
          cin>>ingr[ID].costo;
          cout<<"Ingrese nuevo stock:"; 
          cin>>ingr[ID].stock;
          cout<<"Producto modificado con exito"<<endl;
    }
    else
    {
          cout<<"No existe"<<endl;
    }
    system("pause");
    system("cls");
}



Presenta:
Moskatack versión 1.0

En este minujuego se ponen a prueba los reflejos del jugador. El juego consiste en una mosca atrapada en una tela de araña que debe ser salvada por el jugador.
A medida que se matan las arañas la dificultad incrementa dando la posibilidad de batir records.

Este juego fue desarrollado por "AYD Intecontinental Game Studio" integrado por mí ( Daniel ) y por mi socio Ayi.

El enlace para la descarga se encuentra disponible en la seccion de descargas.

A continuacion dejo fotos de algunos modelos:

Modelo de la araña:
                                       
  Menú principal:
 Modelo de la mosca:
Licencia Creative Commons

No hay comentarios:

Publicar un comentario