Skip to content
Browse files

verison 1.0

  • Loading branch information...
1 parent 2b6f9d0 commit 163852f51ddec4de9727e5abcf105d6d9c6bd289 @calex22 committed Oct 12, 2012
View
2 Trash run/Trash run.vcxproj
@@ -50,7 +50,7 @@
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>SDL.lib;SDLmain.lib;SDL_ttf.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <SubSystem>Console</SubSystem>
+ <SubSystem>Windows</SubSystem>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
View
90 Trash run/game.cpp
@@ -13,6 +13,7 @@ const bool fediaDebug = false; // ENABLE FOR DEBUG
int characterWay = 1;
///////////////////////7
int test;
+ int wrong = 0;
int mapCurrrent = 1;
bool running = 1;
int modeGame = 1;
@@ -26,6 +27,7 @@ SDL_Rect mapObj [882];
SDL_Rect interfaceObject;
int RectX = 1;
int mode = 0;
+int po = 0;
int modeUP = 1;
int modeDOWN = 1;
int modeLEFT = 1;
@@ -40,7 +42,6 @@ void gameClass::drawQ()
ob = SDL_LoadBMP("quest/skilt.bmp");
-
if (gear == 0)
{
srand ( time(NULL) );
@@ -63,6 +64,7 @@ void gameClass::drawQ()
Yes = true;
No = false;
point = point + 5;
+
}
else if(qu == 2)
{
@@ -467,20 +469,20 @@ if(mode == 1)
{
if(modeUP == 1)
{
- character = SDL_LoadBMP("up1.bmp");
+ character = SDL_LoadBMP("graphic/up1.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeUP = 2;
bool running = 0;
}
else if(modeUP == 2)
{
- character = SDL_LoadBMP("up2.bmp");
+ character = SDL_LoadBMP("graphic/up2.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeUP = 3;
}
else if(modeUP == 3)
{
- character = SDL_LoadBMP("up3.bmp");
+ character = SDL_LoadBMP("graphic/up3.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeUP = 1;
}
@@ -514,20 +516,20 @@ if(mode == 1)
if(modeLEFT == 1)
{
- character = SDL_LoadBMP("left1.bmp");
+ character = SDL_LoadBMP("graphic/left1.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeLEFT = 2;
}
else if(modeLEFT == 2)
{
- character = SDL_LoadBMP("left2.bmp");
+ character = SDL_LoadBMP("graphic/left2.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeLEFT = 3;
}
else if(modeLEFT == 3)
{
- character = SDL_LoadBMP("left3.bmp");
+ character = SDL_LoadBMP("graphic/left3.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeLEFT = 1;
}
@@ -562,19 +564,19 @@ if(mode == 1)
{
if(modeDOWN == 1)
{
- character = SDL_LoadBMP("down1.bmp");
+ character = SDL_LoadBMP("graphic/down1.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeDOWN = 2;
}
else if(modeDOWN == 2)
{
- character = SDL_LoadBMP("down2.bmp");
+ character = SDL_LoadBMP("graphic/down2.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeDOWN = 3;
}
else if(modeDOWN == 3)
{
- character = SDL_LoadBMP("down3.bmp");
+ character = SDL_LoadBMP("graphic/down3.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeDOWN = 1;
}
@@ -608,19 +610,19 @@ if(mode == 1)
{
if(modeRIGHT == 1)
{
- character = SDL_LoadBMP("right1.bmp");
+ character = SDL_LoadBMP("graphic/right1.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeRIGHT= 2;
}
else if(modeRIGHT == 2)
{
- character = SDL_LoadBMP("right2.bmp");
+ character = SDL_LoadBMP("graphic/right2.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeRIGHT = 3;
}
else if(modeRIGHT == 3)
{
- character = SDL_LoadBMP("right3.bmp");
+ character = SDL_LoadBMP("graphic/right3.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
modeRIGHT= 1;
}
@@ -697,7 +699,7 @@ void gameClass::drawInterface()
//SDL_Rect texttmp = {0,704}; // FOR NAVN
//SDL_Color color3 = {219,41,41};
- image = SDL_LoadBMP("interface.bmp");
+ image = SDL_LoadBMP("graphic/interface.bmp");
interfaceObject.h = 110;
interfaceObject.w = 1344;
@@ -723,15 +725,15 @@ void gameClass::makeMap(int mapID)
-version 0.1 alpha
*/
- image = SDL_LoadBMP("grass.bmp");
- img2 = SDL_LoadBMP("sti.bmp");
- img3 = SDL_LoadBMP("sti2.bmp");
- img4 = SDL_LoadBMP("sti3.bmp");
- img5 = SDL_LoadBMP("sti4.bmp");
- img6 = SDL_LoadBMP("sti5.bmp");
- img7 = SDL_LoadBMP("sti6.bmp");
- img8 = SDL_LoadBMP("sti7.bmp");
- vand = SDL_LoadBMP("vand.bmp");
+ image = SDL_LoadBMP("graphic/grass.bmp");
+ img2 = SDL_LoadBMP("graphic/sti.bmp");
+ img3 = SDL_LoadBMP("graphic/sti2.bmp");
+ img4 = SDL_LoadBMP("graphic/sti3.bmp");
+ img5 = SDL_LoadBMP("graphic/sti4.bmp");
+ img6 = SDL_LoadBMP("graphic/sti5.bmp");
+ img7 = SDL_LoadBMP("graphic/sti6.bmp");
+ img8 = SDL_LoadBMP("graphic/sti7.bmp");
+ vand = SDL_LoadBMP("graphic/vand.bmp");
if (mapID == 1)
{
for (count1 = 0; count1 <= 10; count1++)
@@ -798,9 +800,10 @@ void gameClass::makeMap(int mapID)
void gameClass::start()
{
+ SDL_WM_SetCaption("SingaPolice",NULL);
SDL_Rect Imgrect;
- image = SDL_LoadBMP("splash.bmp"); // vores super nice splashscreen init.
- character = SDL_LoadBMP("up1.bmp");
+ image = SDL_LoadBMP("graphic/splash.bmp"); // vores super nice splashscreen init.
+ character = SDL_LoadBMP("graphic/up1.bmp");
SDL_SetColorKey(character, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
Imgrect.x = 0; // Vores splashscreen
Imgrect.y = 0;
@@ -860,16 +863,36 @@ void gameClass::start()
break;
case SDLK_y:
modeGame = 1;
+ if(Yes == true)
+ {
+ po = po + 5;
+ }
+ else
+ {
+ wrong = wrong + 1;
+ }
drawQuest();
srand ( time(NULL) );
qu = rand() % 10;
cout << qu;
Yes = 1;
break;
case SDLK_n:
+ if(No == true)
+ {
+ po = po + 5;
+ }
+ else
+ {
+ wrong = wrong + 1;
+ cout << "ØV";
+ }
modeGame = 1;
drawQuest();
- No = 1;
+ srand ( time(NULL) );
+ qu = rand() % 10;
+ cout << qu;
+ Yes = 1;
break;
}
break;
@@ -909,7 +932,20 @@ void gameClass::start()
drawInterface(); // LAVER VORES INTERFACE
movePlayer(); // FLYTER VORES FLOTTE SPILLER
drawRect(); // LAVER VORES SPILLER - BURDE ÆNDRES TIL "fillChar"
+ if(po >= 100)
+ {
+ image = SDL_LoadBMP("graphic/ws.bmp");
+ SDL_BlitSurface(image, NULL, screen, &Imgrect);
+ SDL_FreeSurface(image);
+ }
+ else if(wrong == 5)
+ {
+ image = SDL_LoadBMP("graphic/ls.bmp");
+ SDL_BlitSurface(image, NULL, screen, &Imgrect);
+ SDL_FreeSurface(image);
+
+ }
if(!SDL_BlitSurface(quest, NULL, screen, &questImg[test - 1]))
{
//cout << "Fedia --> " << "splashscreen loaded" << endl;
@@ -948,7 +984,7 @@ void gameClass::start()
void gameClass::drawQuest()
{
srand ( time(NULL) );
- quest = SDL_LoadBMP("sign.bmp");
+ quest = SDL_LoadBMP("graphic/sign.bmp");
test = rand() % 10 + 1;
SDL_SetColorKey(quest, SDL_SRCCOLORKEY, SDL_MapRGB(screen->format, 0xff, 0xff, 0xff));
View
0 Trash run/down1.bmp → Trash run/graphic/down1.bmp
File renamed without changes.
View
0 Trash run/down2.bmp → Trash run/graphic/down2.bmp
File renamed without changes.
View
0 Trash run/down3.bmp → Trash run/graphic/down3.bmp
File renamed without changes.
View
0 Trash run/grass.bmp → Trash run/graphic/grass.bmp
File renamed without changes.
View
0 Trash run/interface.bmp → Trash run/graphic/interface.bmp
File renamed without changes.
View
0 Trash run/left1.bmp → Trash run/graphic/left1.bmp
File renamed without changes.
View
0 Trash run/left2.bmp → Trash run/graphic/left2.bmp
File renamed without changes.
View
0 Trash run/left3.bmp → Trash run/graphic/left3.bmp
File renamed without changes.
View
BIN Trash run/Looser screen.bmp → Trash run/graphic/ls.bmp
Binary file not shown.
View
0 Trash run/right1.bmp → Trash run/graphic/right1.bmp
File renamed without changes.
View
0 Trash run/right2.bmp → Trash run/graphic/right2.bmp
File renamed without changes.
View
0 Trash run/right3.bmp → Trash run/graphic/right3.bmp
File renamed without changes.
View
0 Trash run/sign.bmp → Trash run/graphic/sign.bmp
File renamed without changes.
View
BIN Trash run/graphic/splash.bmp
Binary file not shown.
View
0 Trash run/sti.bmp → Trash run/graphic/sti.bmp
File renamed without changes.
View
0 Trash run/sti2.bmp → Trash run/graphic/sti2.bmp
File renamed without changes.
View
0 Trash run/sti3.bmp → Trash run/graphic/sti3.bmp
File renamed without changes.
View
0 Trash run/sti4.bmp → Trash run/graphic/sti4.bmp
File renamed without changes.
View
0 Trash run/sti5.bmp → Trash run/graphic/sti5.bmp
File renamed without changes.
View
0 Trash run/sti6.bmp → Trash run/graphic/sti6.bmp
File renamed without changes.
View
0 Trash run/sti7.bmp → Trash run/graphic/sti7.bmp
File renamed without changes.
View
0 Trash run/up1.bmp → Trash run/graphic/up1.bmp
File renamed without changes.
View
0 Trash run/up2.bmp → Trash run/graphic/up2.bmp
File renamed without changes.
View
0 Trash run/up3.bmp → Trash run/graphic/up3.bmp
File renamed without changes.
View
0 Trash run/vand.bmp → Trash run/graphic/vand.bmp
File renamed without changes.
View
BIN Trash run/Winner screen.bmp → Trash run/graphic/ws.bmp
Binary file not shown.
View
BIN Trash run/splash.bmp
Binary file not shown.

0 comments on commit 163852f

Please sign in to comment.
Something went wrong with that request. Please try again.