hi everyone
i need help with something
when i compile my code i get this error
fatal error C1075: end of file found before the left brace '{' at 'c:\users\isabel\documents\visual studio 2008\projects\isabel_project1\isabel_project1\main.cpp(55)' was matched
im new to programmming so maybe im overlooking something, if anyone has a clue on why this is happening please post.
here is my code.
#include "DarkGDK.h"
void playerMove() {
if(dbUpKey())
{
dbMoveSprite(4,2);
}
if(dbDownKey())
{
dbMoveSprite(4,-2);
}
if(dbLeftKey())
{
dbRotateSprite(4,90);
dbMoveSprite(4,-2);
dbRotateSprite(4,0);
}
if(dbRightKey())
{
dbRotateSprite(4,90);
dbMoveSprite(4,2);
dbRotateSprite(4,0);
}
}
void getScore(){
int Score = 600;
dbCenterText(20,15,dbStr(Score));
if(dbSpriteCollision(4,0) > 5){
dbClear(0,0,0);
Score=Score-300;
dbCenterText(20,15,dbStr(Score));
}
}
void goalCollide(){
if(dbSpriteCollision(4,5)){
dbCenterText(300,200,"You Win!!!");
}
if(dbSpriteCollision(4,0) > 5){
dbCenterText(300,200,"You Lose!!!");
}
}
void enemyLeft(){
int x1 = dbRND(15);
dbRotateSprite(6,90);
dbMoveSprite(6,x1);
dbRotateSprite(6,0);
}
void DarkGDK(){
dbCenterText(320,200,"Welcome to Isabel Rosarios Project 1!");
dbCenterText(320,210,"Press any key to continue...");
dbWaitKey();
dbSyncOn();
dbSyncRate(60);
dbRandomize(dbTimer());
dbDisableEscapeKey();
dbLoadImage("player.png",4);
dbLoadImage("goal.png",5);
dbLoadImage("enemy.png",6);
int x1=290;
int y1=210;
dbSprite(4,x1,y1,4);
//enemy left
int x2=dbRND(50);
int y2=dbRND(400);
dbSprite(6,x2,y2,6);
while(LoopGDK()) {
dbClear(0,0,0);
getScore();
enemyLeft();
playerMove();
dbSprite(5,550,30,5);
goalCollide();
if(dbEscapeKey()){
break;
}
dbSync();
for ( int i = 1; i < 10; i++ ){
dbDeleteImage(i);
dbDeleteSprite(i);
}
}