ok i have a problom... can some one please help me and tell me whats wrong be for i kill the thing.... and could you also tell me how to stop this happning again... thanks ppl
Code:
#include "Game.h"
#include <stdlib.h>
#include <time.h>
#include <stdio.h>
#include <math.h>
#include <string.h>
#define WINDOW_WIDTH 640
#define WINDOW_HEIGHT 480
struct Points
{
long y;
long x;
};
Points points[7];
void engine::Game_Main(HWND hwnd)
{
HDC hdc;
hdc = GetDC(hwnd);
///backround
HBRUSH black = CreateSolidBrush(RGB(0,0,0));
SelectObject(hdc,black);
RECT rect;
// create a rectangle
rect.left = 0;
rect.top = 0;
rect.right = 1000;
rect.bottom = 1000;
FillRect(hdc,&rect,black);
DeleteObject(black);
//end of backround
SetTextColor(hdc, RGB(100,0,255));
TextOut(hdc,250,0, "Movment Test", strlen("Movment Test"));
TextOut(hdc,0,435,"PanzTec Games.co - http://www.panrix.org", strlen("PanzTec Games.co - http://www.panrix.org"));
ReleaseDC(hwnd, hdc);
}
void engine::ball_prog(HWND hwnd)
{
HDC hdc;
hdc = GetDC(hwnd);
HBRUSH black = CreateSolidBrush(RGB(0,100,150));
SelectObject(hdc,black);
HPEN green_pen = CreatePen(PS_SOLID, 3,RGB(50,0,200));
HPEN old_pen = (HPEN)SelectObject(hdc, green_pen);
balltx += aclx;
ballbx += aclx;
ballty += acly;
ballby += acly;
if(ballbx > 639)
{
aclx = -2;
}
if(ballby > 450)
{
acly = -2;
}
if(ballty < 1)
{
acly = 2;
}
if(balltx < 1)
{
aclx = 2;
}
Ellipse(hdc,balltx,ballty,ballbx,ballby);
//Polygon(hdc, poly[], pointp);
int points_count = 7;
Polygon(hdc , points , points_count);
SelectObject(hdc, old_pen);
DeleteObject(green_pen);
DeleteObject(old_pen);
ReleaseDC(hwnd, hdc);
}
engine::engine()
{
}
engine::~engine()
{
}
void engine::start()
{
int i = 6;
while( --i <= 0)
{
points.y[i] = rand()%500;
points.x[i] = rand()%300;
}
acly = 2;
aclx = 2;
balltx = 300;
ballbx = 350;
ballty = 300;
ballby = 350;
}
this is my error
Code:
--------------------Configuration: new windows - Win32 Debug--------------------
Compiling...
Game.cpp
d:\ufs\coding\main game\new windows\game.cpp(85) : error C2664: 'Polygon' : cannot convert parameter 2 from 'struct Points [7]' to 'const struct tagPOINT *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
d:\ufs\coding\main game\new windows\game.cpp(111) : error C2228: left of '.y' must have class/struct/union type
d:\ufs\coding\main game\new windows\game.cpp(112) : error C2228: left of '.x' must have class/struct/union type
Error executing cl.exe.
new windows.exe - 3 error(s), 0 warning(s)