Lesson 5 problem
Posted: June 3rd, 2012, 12:37 pm
Hey,
I'm Tyas and i'm new here.
I just started your tutorials and now I am at lesson 5.
But when I try to run it is gives this error
1>------ Build started: Project: Chili DirectX Framework, Configuration: Release Win32 ------
1> Game.cpp
1>..\Assets\Game.cpp(26): error C2612: trailing 'identifier' illegal in base/member initializer list
1>..\Assets\Game.cpp(26): error C2064: term does not evaluate to a function taking 1 arguments
1>..\Assets\Game.cpp(27): error C2064: term does not evaluate to a function taking 1 arguments
1>..\Assets\Game.cpp(28): error C2143: syntax error : missing ';' before '{'
1>..\Assets\Game.cpp(31): error C2601: 'Game::Go' : local function definitions are illegal
1>..\Assets\Game.cpp(38): error C2601: 'Game::ComposeFrame' : local function definitions are illegal
1>..\Assets\Game.cpp(75): fatal error C1004: unexpected end-of-file found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It happends when I Try to give the 'x' and 'y' a number in the game.cpp
Do I need to post my whole script or is this error enough?
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()
{
if( kbd.RightIsPressed() )
{
x = x + 1;
}
if( kbd.DownIsPressed() )
{
y = y + 1;
}
if( kbd.UpIsPressed() )
{
y = y - 1;
}
if( kbd.LeftIsPressed() )
{
x = x - 1;
}
gfx.PutPixel( x, y,255,255,255 );
gfx.PutPixel( -5 + x, y,255,255,255 );
gfx.PutPixel( -4 + x, y,255,255,255 );
gfx.PutPixel( -3 + x, y,255,255,255 );
gfx.PutPixel( 3 + x, y,255,255,255 );
gfx.PutPixel( 4 + x, y,255,255,255 );
gfx.PutPixel( 5 + x, y,255,255,255 );
gfx.PutPixel( x,-5 + y,255,255,255 );
gfx.PutPixel( x,-4 + y,255,255,255 );
gfx.PutPixel( x,-3 + y,255,255,255 );
gfx.PutPixel( x, 3 + y,255,255,255 );
gfx.PutPixel( x, 4 + y,255,255,255 );
gfx.PutPixel( x, 5 + y,255,255,255 );
}
I'm Tyas and i'm new here.
I just started your tutorials and now I am at lesson 5.
But when I try to run it is gives this error
1>------ Build started: Project: Chili DirectX Framework, Configuration: Release Win32 ------
1> Game.cpp
1>..\Assets\Game.cpp(26): error C2612: trailing 'identifier' illegal in base/member initializer list
1>..\Assets\Game.cpp(26): error C2064: term does not evaluate to a function taking 1 arguments
1>..\Assets\Game.cpp(27): error C2064: term does not evaluate to a function taking 1 arguments
1>..\Assets\Game.cpp(28): error C2143: syntax error : missing ';' before '{'
1>..\Assets\Game.cpp(31): error C2601: 'Game::Go' : local function definitions are illegal
1>..\Assets\Game.cpp(38): error C2601: 'Game::ComposeFrame' : local function definitions are illegal
1>..\Assets\Game.cpp(75): fatal error C1004: unexpected end-of-file found
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It happends when I Try to give the 'x' and 'y' a number in the game.cpp
Do I need to post my whole script or is this error enough?
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()
{
if( kbd.RightIsPressed() )
{
x = x + 1;
}
if( kbd.DownIsPressed() )
{
y = y + 1;
}
if( kbd.UpIsPressed() )
{
y = y - 1;
}
if( kbd.LeftIsPressed() )
{
x = x - 1;
}
gfx.PutPixel( x, y,255,255,255 );
gfx.PutPixel( -5 + x, y,255,255,255 );
gfx.PutPixel( -4 + x, y,255,255,255 );
gfx.PutPixel( -3 + x, y,255,255,255 );
gfx.PutPixel( 3 + x, y,255,255,255 );
gfx.PutPixel( 4 + x, y,255,255,255 );
gfx.PutPixel( 5 + x, y,255,255,255 );
gfx.PutPixel( x,-5 + y,255,255,255 );
gfx.PutPixel( x,-4 + y,255,255,255 );
gfx.PutPixel( x,-3 + y,255,255,255 );
gfx.PutPixel( x, 3 + y,255,255,255 );
gfx.PutPixel( x, 4 + y,255,255,255 );
gfx.PutPixel( x, 5 + y,255,255,255 );
}