Code: Select all
1>------ Build started: Project: Chili DirectX Framework, Configuration: Release Win32 ------
1> Game.cpp
1>..\Assets\Game.cpp(30): error C2062: type 'void' unexpected
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Code: Select all
/******************************************************************************************
* 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 s;
s = 3;
int gb;
gb = 0;
int r;
r = 255;
if( kbd.RightIsPressed() )
{
x = x + s;
}
if( kbd.LeftIsPressed() )
{
x = x - s;
}
if( kbd.UpIsPressed() )
{
y = y - s;
}
if( kbd.DownIsPressed() )
{
y = y + s;
}
if( kbd.SpaceIsPressed() )
{
s = 1;
}
if( kbd.EnterIsPressed() )
{
s = 8;
}
if( x < 5 )
{
x = 5;
}
if( x > 794 )
{
x = 794;
}
if( y < 5 )
{
y = 5;
}
if( y > 794 )
{
y = 794;
}
if( x < 50 )
{
if( x > 100 )
{
if( y < 50 )
{
if( y < 100 )
{
r = 0;
}
}
}
}
if( x < 300 )
{
if( x > 500 )
{
if( y > 200)
{
if( y < 400 )
{
gb = 0;
}
}
}
}
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 );
}