Problem

The Partridge Family were neither partridges nor a family. Discuss.
Post Reply
Chili is God
Posts: 2
Joined: June 18th, 2012, 2:02 pm

Problem

Post by Chili is God » June 18th, 2012, 2:08 pm

fatal error C1075: end of file found before the left brace '{' at '..\Assets\Game.cpp(39)' was matched

I dont now what is missing!

Here is my code:

/******************************************************************************************
* Chili DirectX Framework Version 11.12.17 *
* Game.cpp *
* Copyright 2011 PlanetChili.net *
* *
* This file is part of The Chili DirectX Framework. *
* *
* The Chili DirectX Framework is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* The Chili DirectX Framework is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with The Chili DirectX Framework. If not, see <http://www.gnu.org/licenses/>. *
******************************************************************************************/
#include "Game.h"

Game::Game( HWND hWnd,const KeyboardServer& kServer )
: gfx ( hWnd ),
kbd( kServer ),
x( 400 ),
y( 300 )

{}

void Game::Go()
{
gfx.BeginFrame();
ComposeFrame();
gfx.EndFrame();
}

void Game::ComposeFrame()
{

int gb = 225;
int speed = 3;
int r = 0;

if (kbd.EnterIsPressed())
{
speed=8;
}
if ( kbd.SpaceIsPressed())
{
speed=1;
}
if ( kbd.RightIsPressed())
{
x=x+speed;
}
if ( kbd.LeftIsPressed())
{
x=x-speed;
}
if ( kbd.DownIsPressed())
{
y=y+speed;
}
if ( kbd.UpIsPressed())
{
y=y-speed;
}

if(x < 5)
{
x=5;
}
if (x > 794)
{
x=794;
}

if(y < 5)
{
y=5;
}
if (y > 594)
{
y=594;
}


if(x > 300)
{
r=255;
}
if(x < 500)
{
r=255;

if(y < 200)
{
r=255;
}
if(y > 400)
{
r=255;
}

gfx.PutPixel( x, y,r,gb,gb);
gfx.PutPixel( -5 + x, y,r,gb,gb);
gfx.PutPixel( -4 + x, y,r,gb,gb);
gfx.PutPixel( -3 + x, y,r,gb,gb);
gfx.PutPixel( 3 + x, y,r,gb,gb);
gfx.PutPixel( 4 + x, y,r,gb,gb);
gfx.PutPixel( 5 + x, y,r,gb,gb);
gfx.PutPixel( x, -5 + y,r,gb,gb);
gfx.PutPixel( x, -4 + y,r,gb,gb);
gfx.PutPixel( x, -3 + y,r,gb,gb);
gfx.PutPixel( x, 3 + y,r,gb,gb);
gfx.PutPixel( x, 4 + y,r,gb,gb);
gfx.PutPixel( x, 5 + y,r,gb,gb);


}

User avatar
LuX
Posts: 1492
Joined: April 22nd, 2012, 12:33 pm
Location: Finland

Re: Problem

Post by LuX » June 18th, 2012, 2:18 pm

You are missing a "}" at one point. It's in the code you gave, and it's so easy to find I won't even tell where it is...
ʕ •ᴥ•ʔ

Chili is God
Posts: 2
Joined: June 18th, 2012, 2:02 pm

Re: Problem

Post by Chili is God » June 18th, 2012, 2:32 pm

Aaaa.Im fool. :lol:

User avatar
XxWalKaxX
Posts: 244
Joined: June 11th, 2012, 7:15 pm

Re: Problem

Post by XxWalKaxX » June 18th, 2012, 2:43 pm

oh wow yea i noticed it right away, brackets and them DAMN semicolons get you every time
What you call a bug...I call a new feature!

Post Reply