New Posts  All Forums:Forum Nav:

Frogger!!! C++ - Page 2

post #11 of 19
thanks good stuff man
Henry I
(13 items)
 
  
CPUMotherboardGraphicsRAM
q6600 G0 Asus P5K-E ASUS EN8500GT SILENT MAGIC 1 x 2gb CRUCIAL / CT25664AA667 
Hard DriveOptical DriveOSMonitor
Seagate 160 gb 7200 Sata Seagate 250 IDE Windows Vista Ultimate 32 Bit DELL 1708 FP 1708FP 17" 
PowerCase
Antec TruePower 550 Antec 300 
  hide details  
Reply
Henry I
(13 items)
 
  
CPUMotherboardGraphicsRAM
q6600 G0 Asus P5K-E ASUS EN8500GT SILENT MAGIC 1 x 2gb CRUCIAL / CT25664AA667 
Hard DriveOptical DriveOSMonitor
Seagate 160 gb 7200 Sata Seagate 250 IDE Windows Vista Ultimate 32 Bit DELL 1708 FP 1708FP 17" 
PowerCase
Antec TruePower 550 Antec 300 
  hide details  
Reply
post #12 of 19
lol thats really hard

and major props for doing that in a friggin dos window
Main Baby
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Q6600 G0 3.2Ghz Asus 750i P5N-D evga 9800gtx 512mb G.Skill 2x2gb PC-8500 DDR2 
Hard DriveOSMonitorPower
320gb 16mb cache Windows 7 Home Premium 64-bit Samsung SyncMaster 932BW 19" Apevia Warlock - 750 watt 
Case
CoolerMaster 690 
  hide details  
Reply
Main Baby
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Q6600 G0 3.2Ghz Asus 750i P5N-D evga 9800gtx 512mb G.Skill 2x2gb PC-8500 DDR2 
Hard DriveOSMonitorPower
320gb 16mb cache Windows 7 Home Premium 64-bit Samsung SyncMaster 932BW 19" Apevia Warlock - 750 watt 
Case
CoolerMaster 690 
  hide details  
Reply
post #13 of 19
Damn it's so hard... Refresh rate sends my eyes on the fritz though...

~B~
2010 MBP 15"
(13 items)
 
  
CPUGraphicsRAMHard Drive
INTEL CORE i5 520M nVIDIA GEFORCE GT 330M 8GB DDR3 @ 1066MHz SEAGATE MOMENTUS XT 500GB 
Optical DriveMonitor
SUPERDRIVE 15.4" @ 1440x900 
  hide details  
Reply
2010 MBP 15"
(13 items)
 
  
CPUGraphicsRAMHard Drive
INTEL CORE i5 520M nVIDIA GEFORCE GT 330M 8GB DDR3 @ 1066MHz SEAGATE MOMENTUS XT 500GB 
Optical DriveMonitor
SUPERDRIVE 15.4" @ 1440x900 
  hide details  
Reply
post #14 of 19
Thread Starter 
hah yeah i know, i havn't gotten around to finishing it and making the final version and completely debugging it. but thanks guys. glad you like it.
HELENKELLER
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 2.4 eVGA 780I EVGA 8800GTS 4 GB OCZ SLI RDY 
Hard DriveOSKeyboardPower
400GB WD/Seagate Internal / 500 WD External Vista X64 Logitech MX5000 Ultra X2 750watt 
CaseMouseMouse Pad
Ultra Aluminus Mid-Tower Logitech MX5000 GO Army 
  hide details  
Reply
HELENKELLER
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 2.4 eVGA 780I EVGA 8800GTS 4 GB OCZ SLI RDY 
Hard DriveOSKeyboardPower
400GB WD/Seagate Internal / 500 WD External Vista X64 Logitech MX5000 Ultra X2 750watt 
CaseMouseMouse Pad
Ultra Aluminus Mid-Tower Logitech MX5000 GO Army 
  hide details  
Reply
post #15 of 19
Thread Starter 
been a while but i figured since im going to college now and starting up programming again. figured i'd bump this thread up to the top. get some more input. still not done yet hah
HELENKELLER
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 2.4 eVGA 780I EVGA 8800GTS 4 GB OCZ SLI RDY 
Hard DriveOSKeyboardPower
400GB WD/Seagate Internal / 500 WD External Vista X64 Logitech MX5000 Ultra X2 750watt 
CaseMouseMouse Pad
Ultra Aluminus Mid-Tower Logitech MX5000 GO Army 
  hide details  
Reply
HELENKELLER
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 2.4 eVGA 780I EVGA 8800GTS 4 GB OCZ SLI RDY 
Hard DriveOSKeyboardPower
400GB WD/Seagate Internal / 500 WD External Vista X64 Logitech MX5000 Ultra X2 750watt 
CaseMouseMouse Pad
Ultra Aluminus Mid-Tower Logitech MX5000 GO Army 
  hide details  
Reply
post #16 of 19
Quote:
Originally Posted by .dp-BarackObama View Post
been a while but i figured since im going to college now and starting up programming again. figured i'd bump this thread up to the top. get some more input. still not done yet hah
your link is expired
Ready 4 Skylake
(15 items)
 
   
CPUMotherboardGraphicsRAM
Intel i5 4690k 4.7Ghz @1.219v 24/7 Gigabyte Z97 Gaming 3 Sapphire Tri-X R9 290x G.Skill Ares  
Hard DriveHard DriveOptical DriveCooling
Samsung Evo 850 250GB Toshiba 3TB LOL Phanteks PH-TC14PE 
OSMonitorKeyboardPower
Dual Boot: Windows 10 Pro 64-bit / Xubuntu 16.04 QNIX QX2710 Evolution 2 OC'd to 110Hz CoolerMaster Quickfire Pro  XFX 850W Pro BE 
CaseMouseMouse Pad
NZXT H440 Monoprice Zowie AM steelseries QcK+ 
CPUMotherboardGraphicsRAM
Core 2 Duo E6600 Asus P5LD2-VM Sapphire HD 3870 512MB 2x1GB OCZ DDR2 800MHz 
Hard DriveOptical DriveCoolingOS
Seagate 500GB Lite-On 24x DVD burner Stock Windows 8.1 
MonitorKeyboardPowerCase
Sharp 47" TV Wireless keyboard/mouse combo Cheap Enermax 400W Banged up Coolermaster Elite 330 
Mouse
Touchpad 
  hide details  
Reply
Ready 4 Skylake
(15 items)
 
   
CPUMotherboardGraphicsRAM
Intel i5 4690k 4.7Ghz @1.219v 24/7 Gigabyte Z97 Gaming 3 Sapphire Tri-X R9 290x G.Skill Ares  
Hard DriveHard DriveOptical DriveCooling
Samsung Evo 850 250GB Toshiba 3TB LOL Phanteks PH-TC14PE 
OSMonitorKeyboardPower
Dual Boot: Windows 10 Pro 64-bit / Xubuntu 16.04 QNIX QX2710 Evolution 2 OC'd to 110Hz CoolerMaster Quickfire Pro  XFX 850W Pro BE 
CaseMouseMouse Pad
NZXT H440 Monoprice Zowie AM steelseries QcK+ 
CPUMotherboardGraphicsRAM
Core 2 Duo E6600 Asus P5LD2-VM Sapphire HD 3870 512MB 2x1GB OCZ DDR2 800MHz 
Hard DriveOptical DriveCoolingOS
Seagate 500GB Lite-On 24x DVD burner Stock Windows 8.1 
MonitorKeyboardPowerCase
Sharp 47" TV Wireless keyboard/mouse combo Cheap Enermax 400W Banged up Coolermaster Elite 330 
Mouse
Touchpad 
  hide details  
Reply
post #17 of 19
Thread Starter 
ah thanks for letting me know :/ i'll have to get into my other HDD and get the exe because this is a new fresh computer.
HELENKELLER
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 2.4 eVGA 780I EVGA 8800GTS 4 GB OCZ SLI RDY 
Hard DriveOSKeyboardPower
400GB WD/Seagate Internal / 500 WD External Vista X64 Logitech MX5000 Ultra X2 750watt 
CaseMouseMouse Pad
Ultra Aluminus Mid-Tower Logitech MX5000 GO Army 
  hide details  
Reply
HELENKELLER
(13 items)
 
  
CPUMotherboardGraphicsRAM
Q6600 @ 2.4 eVGA 780I EVGA 8800GTS 4 GB OCZ SLI RDY 
Hard DriveOSKeyboardPower
400GB WD/Seagate Internal / 500 WD External Vista X64 Logitech MX5000 Ultra X2 750watt 
CaseMouseMouse Pad
Ultra Aluminus Mid-Tower Logitech MX5000 GO Army 
  hide details  
Reply
post #18 of 19
Code:
//***************************************************************************
//George Turkette 
//Copywrite 2008  
// Any questions please email me at geoturk007@yahoo.com 
// Please do NOT claim rights or claim you wrote this program 
//  Enjoy  :D 
// 
//****************************************************************************

//Frogger

//LIBRARIES
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <windows.h>
#include <time.h> 
#include <tchar.h>
using namespace std;
const int height = 18;

//frogger map
// frogger = 6, grass = 1, car = 2, water = 3, fence = 4, blank = 0, log = 7
int map[height][30] = { {4,4,4,4,0,4,4,4,4,4,0,4,4,4,4,0,4,4,4,4,4,0,4,4,4,4,0,4,4,4},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

//globals for map pieces
char one = 176;
char three = 219;
char four = 205;
char eight = 234;
char logg = 219;
char frogger = 1;
char carR = 35;
char carL = 35;
char menuchoice;
char restart;
int z = 666;
int sum = 0;
int sum1 = 0;
int hold = 0;
int life = 5;
int log_count = 0;
int choose = 1;
int restrict = 0;
int ChoiceNumbz = 0;
int score = 250;
int achieve1 = 0;
int achieve2 = 0;
int waste = 0;
int level = 1;
int framerate = 6250;
int levelchange = true;
bool moveb = false;

//frogger begin cordinates
int row = 17;
intcolumn = 14;

//functions
void printmap(void);  //print map function
void color(unsigned short color); //colors
void clrscr(void); //clears screen
void carsearch(void); // moves car to the left
void gameover(void);  //game over
void printovermap(void); // game over map
void logsearch(void); //moves logs across screen
void playfrogger(void); // function to begin game
void froggermenu( int ); // main menu for game
void howtoplay(void); //about game page
void closewindow(void); // closes game
void aboutfrogger(void); //about frogger page
void maximize(void); //maximize screen when game starts


//keydown
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0 )
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1 )

#define VK_LEFT0x25 // left arrow key  
#define VK_UP0x26 // up arrow key  
#define VK_RIGHT0x27 // right arrow key  
#define VK_DOWN0x28 // down arrow key 
#define VK_RETURN0x0D // enter key  // confirm 
#define VK_SPACE0x20 // spacebar 
#define VK_NUMPAD00x60 // Numeric keypad 0 key  


int
main
(void)
{

//maxamize screen once game starts
maximize();

//keydown
froggermenu( ChoiceNumbz ); // print the title screen
    while ( choose == 1 ) { // user wants to choose
        if ( restrict == 0 ) { // keeps the cursor from going uber fast
        if ( !KEYUP( VK_UP ) ) { // the up key is not up
          if ( KEYDOWN( VK_UP ) ) { // the up key is being pressed
            ChoiceNumbz--; // decrement the choice by 1
            if ( ChoiceNumbz < 0 ) { // if the choice becomes less than 0
              ChoiceNumbz = 3; // set the choice to 4
            }
            restrict = 1;  clrscr();  froggermenu( ChoiceNumbz ); // set the restrict, clear the screen, print the new screen
          }
        }
        if ( !KEYUP( VK_DOWN ) ) 
        {
         // the down key is not up
          if ( KEYDOWN( VK_DOWN ) ) { // the down key is being pressed
            ChoiceNumbz++; // increment the choice by 1
            if ( ChoiceNumbz > 3 ) { // if the choice becomes more than 4
              ChoiceNumbz = 0; // set the choice to 0;
            }
            restrict = 1;  clrscr();  froggermenu( ChoiceNumbz ); // set the restrict, clear the screen, print the new screen
          }
        }
        else if(!KEYUP(VK_RETURN))
       {
       //code for when user picks menu item
        if(KEYDOWN(VK_RETURN))
        {
        if(ChoiceNumbz == 0) //start game when chosen
        {
            choose = 0;
            clrscr();
        playfrogger();
        }
        else if(ChoiceNumbz == 1) //goto how to play menu
        {
        choose = 1;
        clrscr();
        howtoplay();
        }
        else if(ChoiceNumbz == 2)
        {
        choose = 2;
        clrscr();
        aboutfrogger();
        }
      else if(ChoiceNumbz == 3) //quits the game function
        {
        choose = 3;
        closewindow();
        }

        }
        }
        
      }
      else if ( restrict > 0 ) { // the restrict is activated
        restrict++; // increment the restriction time by 1
        if ( restrict > 50000000 ) { // restriction time limit is reached
          restrict = 0; // let the user move the cursor again
        }
      }
      else { // an error is encountered
        cout << "ERROR!";
      }
    
  }

froggermenu(ChoiceNumbz);





return 0;
}

void
playfrogger()
{



while(1 == 1)//continous loop
{
log_count++;

//achieve2 = 1;
map[row][column] = 6;
moveb = false;

if(life <= 0)
{
clrscr();
break;
}
clrscr();
printmap();

//change level stuff
levelchange = true;
for(int i = 0; i < 30; i++)
{
if(map[0][i] != 4)
levelchange = false;
}
if(levelchange == true)
{
life += 2;
score += 150;
map[0][4] = 0;
map[0][10] = 0;
map[0][15] = 0;
map[0][21] = 0;
map[0][26] = 0;
level++;
if(framerate > 1000)
framerate -= 550;
}

for(int x = 1; x < framerate; x++) //framerate
for(int y = 1; y < framerate; y++) //frame rate

z = 666;



//puts cars to move left at certain time intervals
if(sum == 2)
{
map[13][29]  = 2;
map[13][28]  = 2;
map[13][27]  = 2;
map[10][29]   = 2;
map[10][28]   = 2;
map[10][29]   = 2;
}
else if(sum == 10)
{
map[9][24]  = 2;
map[9][29]  = 2;
map[9][28]  = 2;
map[9][27]  = 2;
map[9][26]  = 2;
map[9][25]  = 2;
map[15][29]   = 2;
map[15][28]   = 2;
map[15][29]   = 2;
map[15][28]   = 2;
map[10][29]   = 2;
map[10][28]   = 2;
map[10][29]   = 2;
map[10][28]   = 2;
}
else if(sum == 5)
{
map[12][29]  = 2;
map[12][28]  = 2;
map[12][27]  = 2;
map[12][26]  = 2;
map[12][25]  = 2;
map[9][29]   = 2;
map[9][28]   = 2;
}
else if(sum == 15)
{
map[14][29]  = 2;
map[14][28]  = 2;
map[14][27]  = 2;
map[14][26]  = 2;
map[11][29]  = 2;
map[11][28]  = 2;

}
else if(sum == 20)
{
map[15][29]  = 2;
map[15][28]  = 2;
map[15][27]  = 2;
map[15][26]  = 2;
sum = 0; //resets counter
}

//time intervals to put logs on the map and move them across the map
if(sum == 5)
{
map[1][0] = 7;
map[1][1] = 7;
map[1][2] = 7;
map[1][3] = 7;
map[1][4] = 7;
}
else if(sum == 10)
{
map[6][29] = 7;
map[6][28] = 7;
map[6][27] = 7;
map[2][29] = 7;
map[2][28] = 7;
}
else if(sum == 18)
{
map[4][29] = 7;
map[4][28] = 7;
map[4][27] = 7;
map[4][26] = 7; 
map[2][29] = 7;
}
else if (sum == 8)
{
map[3][0] = 7;
map[3][1] = 7;
map[3][2] = 7;
}
else if(sum == 13)
{
map[5][0] = 7;
map[5][1] = 7;
map[5][2] = 7;
map[3][0] = 7;
}

//slows down logssss
if (log_count >= 2)
{
log_count = 0;
logsearch(); // move log
}


carsearch(); // move car function

while( (!KEYDOWN(VK_RIGHT)) && (!KEYDOWN(VK_LEFT)) && (!KEYDOWN(VK_UP)) && (!KEYDOWN(VK_DOWN)) && (!KEYDOWN(VK_RETURN)) )
{
waste++;

if(waste >= 10)
break;
}

//right
if (!KEYUP(VK_RIGHT)){
if(column != 29 && moveb == false)
{
moveb = true;
//collision detection for moving up into car
if(map[row][column + 1] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
//collision detection for water by moving to the right
else if(map[row][column + 1] == 3)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
else if(map[row][column + 1] == 7)
{
map[row][column] = 7;
column += 1;
map[row][column] = 6;
}

//move frogger right
if(map[row][column + 1] == 1)
{
map[row][column] = 1;
column += 1;
map[row][column] = 6;
}
else if(map[row][column+1] == 0)
{
map[row][column] = 0;
column += 1;
map[row][column] = 6;
}
}
}
//LEFT
if (!KEYUP(VK_LEFT)){
if(column != 0 && moveb == false)
{
moveb = true;
//collision detection for moving up into car
if(map[row][column - 1] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;
}
else if(map[row][column - 1] == 3)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}

if(map[row][column - 1] == 1)
{
map[row][column] = 1;
column -= 1;
map[row][column] = 6;
}
else if(map[row][column - 1] == 7)
{
map[row][column] = 7;
column -= 1;
map[row][column] = 6;
}
else if(map[row][column - 1] == 0)
{
map[row][column] = 0;
column -= 1;
map[row][column] = 6;
}
}
}

//DOWN
if (!KEYUP(VK_DOWN)){
if(row != 17 && moveb == false)
{
moveb = true;
//collision detection for moving up into car
if(map[row + 1][column] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 16; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
else
{
map[row][column] = hold;
hold = map[row + 1][column];
row++;
map[row][column] = 6;
}
}
}

// frogger move up
if (!KEYUP(VK_UP)){
if(row > 0 && moveb == false)
{
moveb = true;

//collision detection for moving up into car
if(map[row - 1][column] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
score -= 50;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
//collision detection for water
else if(map[row - 1][column] == 3)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
score -= 50; //takes away 50 points for losing a life
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
else if(map[row - 1][column] == 7)
{
map[row][column] = hold;
hold = map[row - 1][column];
row--;
map[row][column] = 6;
}
else if(map[row - 1][column] == 4)
{
}
//move frogger UP
else
{ 
map[row][column] = hold;
hold = map[row - 1][column];
row--;
map[row][column] = 6;
}
}
}

//frogger scoring system
if(row == 8 && achieve1 == 0)
{
score += 50; // if frogger makes it across traffic you get 50 points.
achieve1 = 1;
}

else if(map[0][4] == 6) // if frogger makes it to a blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}

else if(map[0][10] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}
else if(map[0][15] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column5
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}
else if(map[0][21] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}
else if(map[0][26] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}


sum += 1; 
}

waste = 0;
}

void
aboutfrogger()
{

clrscr();

//title screen printing 
color(12);
cout << "                      _________ _______  _______  _______  _______     \
";
    cout << "             |     /|__   __/(  ____ )(  ____ (       )(  ____     \
";
    cout << "             (    / )   ) (   | (    )|| (    /| () () || (    /    \
";
 cout << "               (_) /    | |   | (____)|| (__    | || || || (__        \
";
    cout << "               ) _ (     | |   |     __)|  __)   | |(_)| ||  __)       \
";
    cout << "              / ( )     | |   | ( (   | (      | |   | || (          \
";
    cout << "             ( /    )   | |   | )  __| (____/| )   ( || (____/    \
";
    cout << "             |/     |   )_(   |/   __/(_______/|/     |(_______/    \
" << flush;
 color(7);
 
 cout << flush;
  
    cout << endl;
 color(10);   
  cout << "          _______  _______  _______  _______  _______  _______  _______   \
";
    cout << "         (  ____ )(  ____ )(  ___  )(  ____ )(  ____) (  ____ )(  ____ )  \
";
    cout << "         | (    /| (    )|| (   ) || (    /| (    /| (    /| (    )|  \
";
    cout << "         | (__    | (____)|| |   | || |      | |      | (__    | (____)|  \
";
    cout << "         |  __)   |     __)| |   | || | ____ | | ____ |  __)   |     __)  \
";
    cout << "         | (      | ( (   | |   | || | _  )| | _  )| (      | ( (     \
";
    cout << "         | )      | )  __| (___) || (___) || (___) || (____/| )  __  \
";
    cout << "         |/       |/   __/(_______)(_______)(_______)(_______/|/   __/  \
" << flush;
    color(7);
    
    cout << flush << endl;;
                                                               
cout << "                 VERSION 1.0 " << endl << endl;
cout << "                                  ABOUT";
for(int k = 0; k < 2; k++)
cout << "" << endl;

cout << " PROGRAMMER:     GEORGE TURKETTE" << endl << endl;
cout << " PROGRAMMED FOR: PERIOD 7 PROGRAMMING CLASS" << endl << endl;
cout << " HELP BY:        PHILIP O'BRIEN - COLLISION/MAP" << endl;
cout << "                 ERIC KIM - MENU KEYDOWN" << endl;
cout << "                 CJ 'JEW' STEELE - GRASS GLITCH / RIGHT LOG MOVEMENT / FENCE SUGGESTION" << endl;

cout << " Copyright © 2008" << endl;


}

void
howtoplay()
{

clrscr();

//title screen printing 
color(12);
cout << "                      _________ _______  _______  _______  _______     \
";
    cout << "             |     /|__   __/(  ____ )(  ____ (       )(  ____     \
";
    cout << "             (    / )   ) (   | (    )|| (    /| () () || (    /    \
";
 cout << "               (_) /    | |   | (____)|| (__    | || || || (__        \
";
    cout << "               ) _ (     | |   |     __)|  __)   | |(_)| ||  __)       \
";
    cout << "              / ( )     | |   | ( (   | (      | |   | || (          \
";
    cout << "             ( /    )   | |   | )  __| (____/| )   ( || (____/    \
";
    cout << "             |/     |   )_(   |/   __/(_______/|/     |(_______/    \
" << flush;
 color(7);
 
 cout << flush;
 
    
    cout << endl;
 color(10);   
  cout << "          _______  _______  _______  _______  _______  _______  _______   \
";
    cout << "         (  ____ )(  ____ )(  ___  )(  ____ )(  ____) (  ____ )(  ____ )  \
";
    cout << "         | (    /| (    )|| (   ) || (    /| (    /| (    /| (    )|  \
";
    cout << "         | (__    | (____)|| |   | || |      | |      | (__    | (____)|  \
";
    cout << "         |  __)   |     __)| |   | || | ____ | | ____ |  __)   |     __)  \
";
    cout << "         | (      | ( (   | |   | || | _  )| | _  )| (      | ( (     \
";
    cout << "         | )      | )  __| (___) || (___) || (___) || (____/| )  __  \
";
    cout << "         |/       |/   __/(_______)(_______)(_______)(_______/|/   __/  \
" << flush;
    color(7);
    
    cout << flush << endl;;
                                                               
cout << "VERSION 1.0 " << endl << endl;
cout << "HOW TO PLAY"<<endl;
for(int k = 0; k < 2; k++)
cout << "" << endl;

cout << " GOAL: To get frogger across the cars and logs to all six of the slots." << endl << endl;
cout << " CONTROLS: UP    Arrow Key     - Move Frogger UP" << endl;
cout << "           DOWN  Arrow Key     - Move Frogger DOWN" << endl;
cout << "           RIGHT Arrow Key     - Move Frogger RIGHT" << endl;
cout << "           LEFT  Arrow Key     - Move Frogger LEFT" << endl;
cout << endl;
cout << " SCORING: Once you get frogger " << frogger << " into a blank space you recieve 50 points." << endl;
cout << "          Each time you loose a life you lose ten points. You start out " << endl;
cout << "          with five lives. You recieve a life one you get the frogger to" << endl;
cout << "          a blank spot. You must avoid the cars " << carR << " and reach the" << endl;
cout << "          logs " << logg << " on the other side." << endl << endl;
cout << "              PRESS 'UP' OR 'DOWN' ARROW KEYS TO RETURN TO MAIN MENU" << endl; 


}


void
closewindow() 
{
HWND windowhandle;
SetConsoleTitle(_T("Program"));
windowhandle=FindWindow(NULL,_T("Program"));
SendMessage (windowhandle, WM_CLOSE, 0, 0);
}

void
logsearch()
{
//even row logs to move to the left
for (int i = 0; i < height; i++) //array
{
if(i == 6 || i == 4 || i == 2)
{
for(int j = 0; j < 30; j++)
{
if(map[i][j] == 7 || map[i][j] == 6) // searches for a log
{
if(map[i][j] == 7)
{
 map[i][j] = 3;

if(j != 0) //if column is not equal to 0 move log
{
map[i][j - 1] = 7; //moves log left
}
}
else if(map[i][j] == 6) // looks for frogger
{
if(map[i][j + 1] != 3)
{
map[i][j] = 7; //future problem
}
else if(map[i][j + 1] == 3)
{
map[i][j] = 3;
}
if(j!= 0)

{
column--;
}
else if(j > 28)
{
life -= 1;
hold = 0;
}

}

}
}
}

//searches for odd row logs to move to the right
if(i == 5 || i == 3 || i == 1)
{
for(int j = 29; j >= 0; j--)
{
if(map[i][j] == 7 || map[i][j] == 6) // searches for a log
{
if(map[i][j] == 7)
{
 map[i][j] = 3;

if(j != 29) //if column is not equal to 0 move log
{
map[i][j + 1] = 7; //moves log left
}
}
else if(map[i][j] == 6) // looks for frogger to move him with the logs
{
map[i][j] = 7;

if(j!= 29)
{
column++;
}
else if(j < 0)
{
life -= 1;
hold = 0;
}
}

}
}
}
}

}

//function to move cars left
void
carsearch()
{

//2 is carR , 5 is carL

for (int i = 0; i < height; i++) //array
{
for(int j = 0; j < 30; j++)
{
if(map[i][j] == 2) // searches for a RIGHT car
{
map[i][j] = 0;
if(j != 0) //if column is not equal to 0 move car
{

//collision detection for moving up into car
if(map[i][j - 1] == 6)
{
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
score -= 50; // takes away 50 points for hitting a car
life -= 1; //takes away a live
hold = 0;
map[row][column] = 6; // moves frogger to spot
}

map[i][j - 1] = 2; //moves car left
}
}


}
}
}


void
printmap()
{
//print map

for (int i = 0; i < height; i++)
{
for(int j = 0; j < 30; j++)
{
//converts number to ascii character
if(map[i][j] == 1)
{
 color(10);
    cout << one << flush;
 color(7);
}
else if(map[i][j] == 0) // blank spot
{
cout << " ";
}
else if(map[i][j] == 3) // water
{
 color(9);
 cout << three << flush;
 color(7);
  }
else if(map[i][j] == 4) // fence
{
color(6);
cout << four << flush;
color(7);
}
else if(map[i][j] == 6) // frogger
{
cout << frogger << flush;
}
else if(map[i][j] == 2) // car
{
color(11);
cout << carR << flush;
color(7);
}
else if(map[i][j] == 7) // log
{
color(22);
cout << logg << flush;
color(7);
}

}

cout <<endl;
}

cout << endl <<endl << "Lives: " << life << "  Level: " << level << "  Score: " << score << endl;

}

//game over map
void
printovermap()
{


//print map
for (int i = 0; i < height; i++)
{
for(int j = 0; j < 30; j++)
{
//converts number to ascii character
if(map[i][j] == 1)
{
 color(10);
cout << one << flush;
 color(7);
}
else if(map[i][j] == 0)
cout << " ";
else if(map[i][j] == 3)
{
 color(19);
cout << three << flush;
 color(7);
}
else if(map[i][j] == 4)
cout << four;
else if(map[i][j] == 6)
{
frogger = 88;
cout << frogger << flush;
}
else if(map[i][j] == 2)
cout << carR << flush;
else if(map[i][j] == 5)
cout << carL << flush;


}

cout <<endl;
}

cout << endl <<endl << "Lives: " << life << endl << "GAME OVER NUB" << endl;
cout << " PRESS 'ENTER' RETURNING TO MENU..." << endl;

if(!KEYUP(VK_RETURN))
{
if(KEYDOWN(VK_RETURN))
{
clrscr();
froggermenu(ChoiceNumbz);
}
}



}

//Body of the maximize function
void maximize(void) {
HWND windowhandle;
SetConsoleTitle(_T("Program"));
windowhandle=FindWindow(NULL,_T("Program"));
SendMessage(windowhandle,WM_SYSKEYDOWN,VK_RETURN,536870912);
}

//MENU
void
froggermenu( int ChoiceNumbz )
{
clrscr();

char gman = 3;
char choice[ 4 ] = { ' ' };
if(ChoiceNumbz == 0){
choice[ 0 ] = gman;
}
else if(ChoiceNumbz == 1){
choice[ 1 ] = gman;
}
else if(ChoiceNumbz == 2){
choice[ 2 ] = gman;
}
else if(ChoiceNumbz == 3){
choice[ 3 ] = gman;
}
else {//errors
cout << "ERROR! THE FAULT OF NON POSITION HOLDING IN KEY CLUB STEVE!";
}




//title screen printing 
color(12);
cout << "                      _________ _______  _______  _______  _______     \
";
    cout << "             |     /|__   __/(  ____ )(  ____ (       )(  ____     \
";
    cout << "             (    / )   ) (   | (    )|| (    /| () () || (    /    \
";
 cout << "               (_) /    | |   | (____)|| (__    | || || || (__        \
";
    cout << "               ) _ (     | |   |     __)|  __)   | |(_)| ||  __)       \
";
    cout << "              / ( )     | |   | ( (   | (      | |   | || (          \
";
    cout << "             ( /    )   | |   | )  __| (____/| )   ( || (____/    \
";
    cout << "             |/     |   )_(   |/   __/(_______/|/     |(_______/    \
" << flush;
 color(7);
 
 cout << flush;
 
    
    cout << endl;
 color(10);   
  cout << "          _______  _______  _______  _______  _______  _______  _______   \
";
    cout << "         (  ____ )(  ____ )(  ___  )(  ____ )(  ____) (  ____ )(  ____ )  \
";
    cout << "         | (    /| (    )|| (   ) || (    /| (    /| (    /| (    )|  \
";
    cout << "         | (__    | (____)|| |   | || |      | |      | (__    | (____)|  \
";
    cout << "         |  __)   |     __)| |   | || | ____ | | ____ |  __)   |     __)  \
";
    cout << "         | (      | ( (   | |   | || | _  )| | _  )| (      | ( (     \
";
    cout << "         | )      | )  __| (___) || (___) || (___) || (____/| )  __  \
";
    cout << "         |/       |/   __/(_______)(_______)(_______)(_______/|/   __/  \
" << flush;
    color(7);
    
    cout << flush << endl;;
                                                               
cout << "                 VERSION 1.0 ";
for(int k = 0; k < 2; k++)
cout << "" << endl;


cout << "                             " << choice[ 0 ] << " PLAY FROGGER\
";
cout << "                             " << choice[ 1 ] << " How To Play\
";
cout << "                             " << choice[ 2 ] << " About\
";
cout << "                             " << choice[ 3 ] << " Exit\
"; 

}

//game over
void
gameover()
{


cout << "GAME OVER" << endl;


}
//color
void color(unsigned short color)
{
    HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hcon,color);
}

//clear screen
void clrscr(void)
{
  HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
  COORD coord = {0, 0};
  DWORD count;

  CONSOLE_SCREEN_BUFFER_INFO csbi;
  GetConsoleScreenBufferInfo(hStdOut, &csbi);

  FillConsoleOutputCharacter(hStdOut, ' ', csbi.dwSize.X * csbi.dwSize.Y, coord, &count);

  SetConsoleCursorPosition(hStdOut, coord);
}
had some errors on visual c++ 2008 so i fixed it for you but it still has some bugs.
edit : so the text works now ( you forgot the '\\' before 'n' ) but it exits when you try about. how to play works tho. also you still die when going on the blue background. lol, its water
Edited by newbie1911 - 9/16/09 at 6:02am
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
Reply
Pepe Silvia
(13 items)
 
  
CPUMotherboardGraphicsRAM
255 @ 4 Ghz MSI 870-C45 GT 520 @ 1Ghz Crucial Rendition 4GB DDR3 
Hard DriveOSMonitorPower
Hitachi 1TB Win 7 19" 420W 
  hide details  
Reply
post #19 of 19
Quote:
Originally Posted by newbie1911 View Post
Code:
//***************************************************************************
//George Turkette 
//Copywrite 2008  
// Any questions please email me at geoturk007@yahoo.com 
// Please do NOT claim rights or claim you wrote this program 
//  Enjoy  :D 
// 
//****************************************************************************

//Frogger

//LIBRARIES
#include <iostream>
#include <iomanip>
#include <stdlib.h>
#include <windows.h>
#include <time.h> 
#include <tchar.h>
using namespace std;
const int height = 18;

//frogger map
// frogger = 6, grass = 1, car = 2, water = 3, fence = 4, blank = 0, log = 7
int map[height][30] = { {4,4,4,4,0,4,4,4,4,4,0,4,4,4,4,0,4,4,4,4,4,0,4,4,4,4,0,4,4,4},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3},
{4,4,4,4,4,4,4,4,4,4,4,4,4,0,0,0,0,4,4,4,4,4,4,4,4,4,4,4,4,4},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0}};

//globals for map pieces
char one = 176;
char three = 219;
char four = 205;
char eight = 234;
char logg = 219;
char frogger = 1;
char carR = 35;
char carL = 35;
char menuchoice;
char restart;
int z = 666;
int sum = 0;
int sum1 = 0;
int hold = 0;
int life = 5;
int log_count = 0;
int choose = 1;
int restrict = 0;
int ChoiceNumbz = 0;
int score = 250;
int achieve1 = 0;
int achieve2 = 0;
int waste = 0;
int level = 1;
int framerate = 6250;
int levelchange = true;
bool moveb = false;

//frogger begin cordinates
int row = 17;
intcolumn = 14;

//functions
void printmap(void);  //print map function
void color(unsigned short color); //colors
void clrscr(void); //clears screen
void carsearch(void); // moves car to the left
void gameover(void);  //game over
void printovermap(void); // game over map
void logsearch(void); //moves logs across screen
void playfrogger(void); // function to begin game
void froggermenu( int ); // main menu for game
void howtoplay(void); //about game page
void closewindow(void); // closes game
void aboutfrogger(void); //about frogger page
void maximize(void); //maximize screen when game starts


//keydown
#define KEYDOWN(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 1 : 0 )
#define KEYUP(vk_code) ((GetAsyncKeyState(vk_code) & 0x8000) ? 0 : 1 )

#define VK_LEFT0x25 // left arrow key  
#define VK_UP0x26 // up arrow key  
#define VK_RIGHT0x27 // right arrow key  
#define VK_DOWN0x28 // down arrow key 
#define VK_RETURN0x0D // enter key  // confirm 
#define VK_SPACE0x20 // spacebar 
#define VK_NUMPAD00x60 // Numeric keypad 0 key  


int
main
(void)
{

//maxamize screen once game starts
maximize();

//keydown
froggermenu( ChoiceNumbz ); // print the title screen
    while ( choose == 1 ) { // user wants to choose
        if ( restrict == 0 ) { // keeps the cursor from going uber fast
        if ( !KEYUP( VK_UP ) ) { // the up key is not up
          if ( KEYDOWN( VK_UP ) ) { // the up key is being pressed
            ChoiceNumbz--; // decrement the choice by 1
            if ( ChoiceNumbz < 0 ) { // if the choice becomes less than 0
              ChoiceNumbz = 3; // set the choice to 4
            }
            restrict = 1;  clrscr();  froggermenu( ChoiceNumbz ); // set the restrict, clear the screen, print the new screen
          }
        }
        if ( !KEYUP( VK_DOWN ) ) 
        {
         // the down key is not up
          if ( KEYDOWN( VK_DOWN ) ) { // the down key is being pressed
            ChoiceNumbz++; // increment the choice by 1
            if ( ChoiceNumbz > 3 ) { // if the choice becomes more than 4
              ChoiceNumbz = 0; // set the choice to 0;
            }
            restrict = 1;  clrscr();  froggermenu( ChoiceNumbz ); // set the restrict, clear the screen, print the new screen
          }
        }
        else if(!KEYUP(VK_RETURN))
       {
       //code for when user picks menu item
        if(KEYDOWN(VK_RETURN))
        {
        if(ChoiceNumbz == 0) //start game when chosen
        {
            choose = 0;
            clrscr();
        playfrogger();
        }
        else if(ChoiceNumbz == 1) //goto how to play menu
        {
        choose = 1;
        clrscr();
        howtoplay();
        }
        else if(ChoiceNumbz == 2)
        {
        choose = 2;
        clrscr();
        aboutfrogger();
        }
      else if(ChoiceNumbz == 3) //quits the game function
        {
        choose = 3;
        closewindow();
        }

        }
        }
        
      }
      else if ( restrict > 0 ) { // the restrict is activated
        restrict++; // increment the restriction time by 1
        if ( restrict > 50000000 ) { // restriction time limit is reached
          restrict = 0; // let the user move the cursor again
        }
      }
      else { // an error is encountered
        cout << "ERROR!";
      }
    
  }

froggermenu(ChoiceNumbz);





return 0;
}

void
playfrogger()
{



while(1 == 1)//continous loop
{
log_count++;

//achieve2 = 1;
map[row][column] = 6;
moveb = false;

if(life <= 0)
{
clrscr();
break;
}
clrscr();
printmap();

//change level stuff
levelchange = true;
for(int i = 0; i < 30; i++)
{
if(map[0][i] != 4)
levelchange = false;
}
if(levelchange == true)
{
life += 2;
score += 150;
map[0][4] = 0;
map[0][10] = 0;
map[0][15] = 0;
map[0][21] = 0;
map[0][26] = 0;
level++;
if(framerate > 1000)
framerate -= 550;
}

for(int x = 1; x < framerate; x++) //framerate
for(int y = 1; y < framerate; y++) //frame rate

z = 666;



//puts cars to move left at certain time intervals
if(sum == 2)
{
map[13][29]  = 2;
map[13][28]  = 2;
map[13][27]  = 2;
map[10][29]   = 2;
map[10][28]   = 2;
map[10][29]   = 2;
}
else if(sum == 10)
{
map[9][24]  = 2;
map[9][29]  = 2;
map[9][28]  = 2;
map[9][27]  = 2;
map[9][26]  = 2;
map[9][25]  = 2;
map[15][29]   = 2;
map[15][28]   = 2;
map[15][29]   = 2;
map[15][28]   = 2;
map[10][29]   = 2;
map[10][28]   = 2;
map[10][29]   = 2;
map[10][28]   = 2;
}
else if(sum == 5)
{
map[12][29]  = 2;
map[12][28]  = 2;
map[12][27]  = 2;
map[12][26]  = 2;
map[12][25]  = 2;
map[9][29]   = 2;
map[9][28]   = 2;
}
else if(sum == 15)
{
map[14][29]  = 2;
map[14][28]  = 2;
map[14][27]  = 2;
map[14][26]  = 2;
map[11][29]  = 2;
map[11][28]  = 2;

}
else if(sum == 20)
{
map[15][29]  = 2;
map[15][28]  = 2;
map[15][27]  = 2;
map[15][26]  = 2;
sum = 0; //resets counter
}

//time intervals to put logs on the map and move them across the map
if(sum == 5)
{
map[1][0] = 7;
map[1][1] = 7;
map[1][2] = 7;
map[1][3] = 7;
map[1][4] = 7;
}
else if(sum == 10)
{
map[6][29] = 7;
map[6][28] = 7;
map[6][27] = 7;
map[2][29] = 7;
map[2][28] = 7;
}
else if(sum == 18)
{
map[4][29] = 7;
map[4][28] = 7;
map[4][27] = 7;
map[4][26] = 7; 
map[2][29] = 7;
}
else if (sum == 8)
{
map[3][0] = 7;
map[3][1] = 7;
map[3][2] = 7;
}
else if(sum == 13)
{
map[5][0] = 7;
map[5][1] = 7;
map[5][2] = 7;
map[3][0] = 7;
}

//slows down logssss
if (log_count >= 2)
{
log_count = 0;
logsearch(); // move log
}


carsearch(); // move car function

while( (!KEYDOWN(VK_RIGHT)) && (!KEYDOWN(VK_LEFT)) && (!KEYDOWN(VK_UP)) && (!KEYDOWN(VK_DOWN)) && (!KEYDOWN(VK_RETURN)) )
{
waste++;

if(waste >= 10)
break;
}

//right
if (!KEYUP(VK_RIGHT)){
if(column != 29 && moveb == false)
{
moveb = true;
//collision detection for moving up into car
if(map[row][column + 1] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
//collision detection for water by moving to the right
else if(map[row][column + 1] == 3)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
else if(map[row][column + 1] == 7)
{
map[row][column] = 7;
column += 1;
map[row][column] = 6;
}

//move frogger right
if(map[row][column + 1] == 1)
{
map[row][column] = 1;
column += 1;
map[row][column] = 6;
}
else if(map[row][column+1] == 0)
{
map[row][column] = 0;
column += 1;
map[row][column] = 6;
}
}
}
//LEFT
if (!KEYUP(VK_LEFT)){
if(column != 0 && moveb == false)
{
moveb = true;
//collision detection for moving up into car
if(map[row][column - 1] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;
}
else if(map[row][column - 1] == 3)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}

if(map[row][column - 1] == 1)
{
map[row][column] = 1;
column -= 1;
map[row][column] = 6;
}
else if(map[row][column - 1] == 7)
{
map[row][column] = 7;
column -= 1;
map[row][column] = 6;
}
else if(map[row][column - 1] == 0)
{
map[row][column] = 0;
column -= 1;
map[row][column] = 6;
}
}
}

//DOWN
if (!KEYUP(VK_DOWN)){
if(row != 17 && moveb == false)
{
moveb = true;
//collision detection for moving up into car
if(map[row + 1][column] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 16; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
else
{
map[row][column] = hold;
hold = map[row + 1][column];
row++;
map[row][column] = 6;
}
}
}

// frogger move up
if (!KEYUP(VK_UP)){
if(row > 0 && moveb == false)
{
moveb = true;

//collision detection for moving up into car
if(map[row - 1][column] == 2)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
score -= 50;
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
//collision detection for water
else if(map[row - 1][column] == 3)
{
map[row][column] = 0; // deletes old frogger
row = 17; //resets row column to frogger starting spot
column = 14;
score -= 50; //takes away 50 points for losing a life
life -= 1; //takes away a live
hold = 0;

map[row][column] = 6; // moves frogger to spot
}
else if(map[row - 1][column] == 7)
{
map[row][column] = hold;
hold = map[row - 1][column];
row--;
map[row][column] = 6;
}
else if(map[row - 1][column] == 4)
{
}
//move frogger UP
else
{ 
map[row][column] = hold;
hold = map[row - 1][column];
row--;
map[row][column] = 6;
}
}
}

//frogger scoring system
if(row == 8 && achieve1 == 0)
{
score += 50; // if frogger makes it across traffic you get 50 points.
achieve1 = 1;
}

else if(map[0][4] == 6) // if frogger makes it to a blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}

else if(map[0][10] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}
else if(map[0][15] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column5
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}
else if(map[0][21] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}
else if(map[0][26] == 6) // frogger makes it to another blank spot
{
map[row][column] = 4;
row = 17; // resets row
column = 14; // resets column
    life += 1; // adds one to froggers life
score += 50; // adds points to score
cout << "/a";
map[row][column] = 6; // resets him to beginning
}


sum += 1; 
}

waste = 0;
}

void
aboutfrogger()
{

clrscr();

//title screen printing 
color(12);
cout << "                      _________ _______  _______  _______  _______     \
";
    cout << "             |     /|__   __/(  ____ )(  ____ (       )(  ____     \
";
    cout << "             (    / )   ) (   | (    )|| (    /| () () || (    /    \
";
 cout << "               (_) /    | |   | (____)|| (__    | || || || (__        \
";
    cout << "               ) _ (     | |   |     __)|  __)   | |(_)| ||  __)       \
";
    cout << "              / ( )     | |   | ( (   | (      | |   | || (          \
";
    cout << "             ( /    )   | |   | )  __| (____/| )   ( || (____/    \
";
    cout << "             |/     |   )_(   |/   __/(_______/|/     |(_______/    \
" << flush;
 color(7);
 
 cout << flush;
  
    cout << endl;
 color(10);   
  cout << "          _______  _______  _______  _______  _______  _______  _______   \
";
    cout << "         (  ____ )(  ____ )(  ___  )(  ____ )(  ____) (  ____ )(  ____ )  \
";
    cout << "         | (    /| (    )|| (   ) || (    /| (    /| (    /| (    )|  \
";
    cout << "         | (__    | (____)|| |   | || |      | |      | (__    | (____)|  \
";
    cout << "         |  __)   |     __)| |   | || | ____ | | ____ |  __)   |     __)  \
";
    cout << "         | (      | ( (   | |   | || | _  )| | _  )| (      | ( (     \
";
    cout << "         | )      | )  __| (___) || (___) || (___) || (____/| )  __  \
";
    cout << "         |/       |/   __/(_______)(_______)(_______)(_______/|/   __/  \
" << flush;
    color(7);
    
    cout << flush << endl;;
                                                               
cout << "                 VERSION 1.0 " << endl << endl;
cout << "                                  ABOUT";
for(int k = 0; k < 2; k++)
cout << "" << endl;

cout << " PROGRAMMER:     GEORGE TURKETTE" << endl << endl;
cout << " PROGRAMMED FOR: PERIOD 7 PROGRAMMING CLASS" << endl << endl;
cout << " HELP BY:        PHILIP O'BRIEN - COLLISION/MAP" << endl;
cout << "                 ERIC KIM - MENU KEYDOWN" << endl;
cout << "                 CJ 'JEW' STEELE - GRASS GLITCH / RIGHT LOG MOVEMENT / FENCE SUGGESTION" << endl;

cout << " Copyright © 2008" << endl;


}

void
howtoplay()
{

clrscr();

//title screen printing 
color(12);
cout << "                      _________ _______  _______  _______  _______     \
";
    cout << "             |     /|__   __/(  ____ )(  ____ (       )(  ____     \
";
    cout << "             (    / )   ) (   | (    )|| (    /| () () || (    /    \
";
 cout << "               (_) /    | |   | (____)|| (__    | || || || (__        \
";
    cout << "               ) _ (     | |   |     __)|  __)   | |(_)| ||  __)       \
";
    cout << "              / ( )     | |   | ( (   | (      | |   | || (          \
";
    cout << "             ( /    )   | |   | )  __| (____/| )   ( || (____/    \
";
    cout << "             |/     |   )_(   |/   __/(_______/|/     |(_______/    \
" << flush;
 color(7);
 
 cout << flush;
 
    
    cout << endl;
 color(10);   
  cout << "          _______  _______  _______  _______  _______  _______  _______   \
";
    cout << "         (  ____ )(  ____ )(  ___  )(  ____ )(  ____) (  ____ )(  ____ )  \
";
    cout << "         | (    /| (    )|| (   ) || (    /| (    /| (    /| (    )|  \
";
    cout << "         | (__    | (____)|| |   | || |      | |      | (__    | (____)|  \
";
    cout << "         |  __)   |     __)| |   | || | ____ | | ____ |  __)   |     __)  \
";
    cout << "         | (      | ( (   | |   | || | _  )| | _  )| (      | ( (     \
";
    cout << "         | )      | )  __| (___) || (___) || (___) || (____/| )  __  \
";
    cout << "         |/       |/   __/(_______)(_______)(_______)(_______/|/   __/  \
" << flush;
    color(7);
    
    cout << flush << endl;;
                                                               
cout << "VERSION 1.0 " << endl << endl;
cout << "HOW TO PLAY"<<endl;
for(int k = 0; k < 2; k++)
cout << "" << endl;

cout << " GOAL: To get frogger across the cars and logs to all six of the slots." << endl << endl;
cout << " CONTROLS: UP    Arrow Key     - Move Frogger UP" << endl;
cout << "           DOWN  Arrow Key     - Move Frogger DOWN" << endl;
cout << "           RIGHT Arrow Key     - Move Frogger RIGHT" << endl;
cout << "           LEFT  Arrow Key     - Move Frogger LEFT" << endl;
cout << endl;
cout << " SCORING: Once you get frogger " << frogger << " into a blank space you recieve 50 points." << endl;
cout << "          Each time you loose a life you lose ten points. You start out " << endl;
cout << "          with five lives. You recieve a life one you get the frogger to" << endl;
cout << "          a blank spot. You must avoid the cars " << carR << " and reach the" << endl;
cout << "          logs " << logg << " on the other side." << endl << endl;
cout << "              PRESS 'UP' OR 'DOWN' ARROW KEYS TO RETURN TO MAIN MENU" << endl; 


}


void
closewindow() 
{
HWND windowhandle;
SetConsoleTitle(_T("Program"));
windowhandle=FindWindow(NULL,_T("Program"));
SendMessage (windowhandle, WM_CLOSE, 0, 0);
}

void
logsearch()
{
//even row logs to move to the left
for (int i = 0; i < height; i++) //array
{
if(i == 6 || i == 4 || i == 2)
{
for(int j = 0; j < 30; j++)
{
if(map[i][j] == 7 || map[i][j] == 6) // searches for a log
{
if(map[i][j] == 7)
{
 map[i][j] = 3;

if(j != 0) //if column is not equal to 0 move log
{
map[i][j - 1] = 7; //moves log left
}
}
else if(map[i][j] == 6) // looks for frogger
{
if(map[i][j + 1] != 3)
{
map[i][j] = 7; //future problem
}
else if(map[i][j + 1] == 3)
{
map[i][j] = 3;
}
if(j!= 0)

{
column--;
}
else if(j > 28)
{
life -= 1;
hold = 0;
}

}

}
}
}

//searches for odd row logs to move to the right
if(i == 5 || i == 3 || i == 1)
{
for(int j = 29; j >= 0; j--)
{
if(map[i][j] == 7 || map[i][j] == 6) // searches for a log
{
if(map[i][j] == 7)
{
 map[i][j] = 3;

if(j != 29) //if column is not equal to 0 move log
{
map[i][j + 1] = 7; //moves log left
}
}
else if(map[i][j] == 6) // looks for frogger to move him with the logs
{
map[i][j] = 7;

if(j!= 29)
{
column++;
}
else if(j < 0)
{
life -= 1;
hold = 0;
}
}

}
}
}
}

}

//function to move cars left
void
carsearch()
{

//2 is carR , 5 is carL

for (int i = 0; i < height; i++) //array
{
for(int j = 0; j < 30; j++)
{
if(map[i][j] == 2) // searches for a RIGHT car
{
map[i][j] = 0;
if(j != 0) //if column is not equal to 0 move car
{

//collision detection for moving up into car
if(map[i][j - 1] == 6)
{
row = 17; //resets row column to frogger starting spot
column = 14;
achieve1 = 0;
score -= 50; // takes away 50 points for hitting a car
life -= 1; //takes away a live
hold = 0;
map[row][column] = 6; // moves frogger to spot
}

map[i][j - 1] = 2; //moves car left
}
}


}
}
}


void
printmap()
{
//print map

for (int i = 0; i < height; i++)
{
for(int j = 0; j < 30; j++)
{
//converts number to ascii character
if(map[i][j] == 1)
{
 color(10);
    cout << one << flush;
 color(7);
}
else if(map[i][j] == 0) // blank spot
{
cout << " ";
}
else if(map[i][j] == 3) // water
{
 color(9);
 cout << three << flush;
 color(7);
  }
else if(map[i][j] == 4) // fence
{
color(6);
cout << four << flush;
color(7);
}
else if(map[i][j] == 6) // frogger
{
cout << frogger << flush;
}
else if(map[i][j] == 2) // car
{
color(11);
cout << carR << flush;
color(7);
}
else if(map[i][j] == 7) // log
{
color(22);
cout << logg << flush;
color(7);
}

}

cout <<endl;
}

cout << endl <<endl << "Lives: " << life << "  Level: " << level << "  Score: " << score << endl;

}

//game over map
void
printovermap()
{


//print map
for (int i = 0; i < height; i++)
{
for(int j = 0; j < 30; j++)
{
//converts number to ascii character
if(map[i][j] == 1)
{
 color(10);
cout << one << flush;
 color(7);
}
else if(map[i][j] == 0)
cout << " ";
else if(map[i][j] == 3)
{
 color(19);
cout << three << flush;
 color(7);
}
else if(map[i][j] == 4)
cout << four;
else if(map[i][j] == 6)
{
frogger = 88;
cout << frogger << flush;
}
else if(map[i][j] == 2)
cout << carR << flush;
else if(map[i][j] == 5)
cout << carL << flush;


}

cout <<endl;
}

cout << endl <<endl << "Lives: " << life << endl << "GAME OVER NUB" << endl;
cout << " PRESS 'ENTER' RETURNING TO MENU..." << endl;

if(!KEYUP(VK_RETURN))
{
if(KEYDOWN(VK_RETURN))
{
clrscr();
froggermenu(ChoiceNumbz);
}
}



}

//Body of the maximize function
void maximize(void) {
HWND windowhandle;
SetConsoleTitle(_T("Program"));
windowhandle=FindWindow(NULL,_T("Program"));
SendMessage(windowhandle,WM_SYSKEYDOWN,VK_RETURN,536870912);
}

//MENU
void
froggermenu( int ChoiceNumbz )
{
clrscr();

char gman = 3;
char choice[ 4 ] = { ' ' };
if(ChoiceNumbz == 0){
choice[ 0 ] = gman;
}
else if(ChoiceNumbz == 1){
choice[ 1 ] = gman;
}
else if(ChoiceNumbz == 2){
choice[ 2 ] = gman;
}
else if(ChoiceNumbz == 3){
choice[ 3 ] = gman;
}
else {//errors
cout << "ERROR! THE FAULT OF NON POSITION HOLDING IN KEY CLUB STEVE!";
}




//title screen printing 
color(12);
cout << "                      _________ _______  _______  _______  _______     \
";
    cout << "             |     /|__   __/(  ____ )(  ____ (       )(  ____     \
";
    cout << "             (    / )   ) (   | (    )|| (    /| () () || (    /    \
";
 cout << "               (_) /    | |   | (____)|| (__    | || || || (__        \
";
    cout << "               ) _ (     | |   |     __)|  __)   | |(_)| ||  __)       \
";
    cout << "              / ( )     | |   | ( (   | (      | |   | || (          \
";
    cout << "             ( /    )   | |   | )  __| (____/| )   ( || (____/    \
";
    cout << "             |/     |   )_(   |/   __/(_______/|/     |(_______/    \
" << flush;
 color(7);
 
 cout << flush;
 
    
    cout << endl;
 color(10);   
  cout << "          _______  _______  _______  _______  _______  _______  _______   \
";
    cout << "         (  ____ )(  ____ )(  ___  )(  ____ )(  ____) (  ____ )(  ____ )  \
";
    cout << "         | (    /| (    )|| (   ) || (    /| (    /| (    /| (    )|  \
";
    cout << "         | (__    | (____)|| |   | || |      | |      | (__    | (____)|  \
";
    cout << "         |  __)   |     __)| |   | || | ____ | | ____ |  __)   |     __)  \
";
    cout << "         | (      | ( (   | |   | || | _  )| | _  )| (      | ( (     \
";
    cout << "         | )      | )  __| (___) || (___) || (___) || (____/| )  __  \
";
    cout << "         |/       |/   __/(_______)(_______)(_______)(_______/|/   __/  \
" << flush;
    color(7);
    
    cout << flush << endl;;
                                                               
cout << "                 VERSION 1.0 ";
for(int k = 0; k < 2; k++)
cout << "" << endl;


cout << "                             " << choice[ 0 ] << " PLAY FROGGER\
";
cout << "                             " << choice[ 1 ] << " How To Play\
";
cout << "                             " << choice[ 2 ] << " About\
";
cout << "                             " << choice[ 3 ] << " Exit\
"; 

}

//game over
void
gameover()
{


cout << "GAME OVER" << endl;


}
//color
void color(unsigned short color)
{
    HANDLE hcon = GetStdHandle(STD_OUTPUT_HANDLE);
    SetConsoleTextAttribute(hcon,color);
}

//clear screen
void clrscr(void)
{
  HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
  COORD coord = {0, 0};
  DWORD count;

  CONSOLE_SCREEN_BUFFER_INFO csbi;
  GetConsoleScreenBufferInfo(hStdOut, &csbi);

  FillConsoleOutputCharacter(hStdOut, ' ', csbi.dwSize.X * csbi.dwSize.Y, coord, &count);

  SetConsoleCursorPosition(hStdOut, coord);
}
had some errors on visual c++ 2008 so i fixed it for you but it still has some bugs.
edit : so the text works now ( you forgot the '\\' before 'n' ) but it exits when you try about. how to play works tho. also you still die when going on the blue background. lol, its water
Ah, that's better. I was sitting here trying to figure out all the errors, but I'm only in my third week of C++ lol
Ganymede
(7 items)
 
  
CPUGraphicsRAMHard Drive
i7 4790T Nvidia GTX 860m 2GB 16GB Corsair DDR3L 1600Mhz 500GB Samsung 850 EVO 
OSCaseAudio
Windows 10 Pro x64 Alienware Steam Machine Creative Sound Blaster Omni 
  hide details  
Reply
Ganymede
(7 items)
 
  
CPUGraphicsRAMHard Drive
i7 4790T Nvidia GTX 860m 2GB 16GB Corsair DDR3L 1600Mhz 500GB Samsung 850 EVO 
OSCaseAudio
Windows 10 Pro x64 Alienware Steam Machine Creative Sound Blaster Omni 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Application Programming