What do you think of my game I made, strictly in Windows API?
-
Here is the source code:
#include <windows.h>
HDC hdc;
HWND hwnd;
PAINTSTRUCT ps;
bool room1 = 0;
short constupdate()
{
while(1)
{
InvalidateRect(hwnd, NULL, TRUE);
}
}
int floor;
static int x, y;
int jmpjmp = x+5;
int atpos = jmpjmp;
bool right = 1;
bool left = 0;
void first();
bool keyinroom = 1;
bool havekey = 0;
bool inmenu = 0;
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);/* Make the class name into a global variable */
= "CodeBlocksWindowsApp";int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass *//\* The Window structure \*/ wincl.hInstance = hThisInstance; wincl.lpszClassName = szClassName; wincl.lpfnWndProc = WindowProcedure; /\* This function is called by windows \*/ wincl.style = CS\_DBLCLKS; /\* Catch double-clicks \*/ wincl.cbSize = sizeof (WNDCLASSEX); /\* Use default icon and mouse-pointer \*/ wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION); wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION); wincl.hCursor = LoadCursor (NULL, IDC\_ARROW); wincl.lpszMenuName = NULL; /\* No menu \*/ wincl.cbClsExtra = 0; /\* No extra bytes after the window class \*/ wincl.cbWndExtra = 0; /\* structure or the window instance \*/ /\* Use Windows's default colour as the background of the window \*/ wincl.hbrBackground = (HBRUSH) COLOR\_BACKGROUND+7; /\* Register the window class, and if it fails quit the program \*/ if (!RegisterClassEx (&wincl)) return 0; /\* The class is registered, let's create the program\*/ hwnd = CreateWindowEx ( 0, /\* Extended possibilites for variation \*/ szClassName, /\* Classname \*/ "Window's GDI Pixel Game", /\* Title Text \*/ WS\_OVERLAPPEDWINDOW, /\* default window \*/ CW\_USEDEFAULT, /\* Windows decides the position \*/ CW\_USEDEFAULT, /\* where the window ends up on the screen \*/ 544, /\* The program's width \*/ 375,
-
Here is the source code:
#include <windows.h>
HDC hdc;
HWND hwnd;
PAINTSTRUCT ps;
bool room1 = 0;
short constupdate()
{
while(1)
{
InvalidateRect(hwnd, NULL, TRUE);
}
}
int floor;
static int x, y;
int jmpjmp = x+5;
int atpos = jmpjmp;
bool right = 1;
bool left = 0;
void first();
bool keyinroom = 1;
bool havekey = 0;
bool inmenu = 0;
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);/* Make the class name into a global variable */
= "CodeBlocksWindowsApp";int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass *//\* The Window structure \*/ wincl.hInstance = hThisInstance; wincl.lpszClassName = szClassName; wincl.lpfnWndProc = WindowProcedure; /\* This function is called by windows \*/ wincl.style = CS\_DBLCLKS; /\* Catch double-clicks \*/ wincl.cbSize = sizeof (WNDCLASSEX); /\* Use default icon and mouse-pointer \*/ wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION); wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION); wincl.hCursor = LoadCursor (NULL, IDC\_ARROW); wincl.lpszMenuName = NULL; /\* No menu \*/ wincl.cbClsExtra = 0; /\* No extra bytes after the window class \*/ wincl.cbWndExtra = 0; /\* structure or the window instance \*/ /\* Use Windows's default colour as the background of the window \*/ wincl.hbrBackground = (HBRUSH) COLOR\_BACKGROUND+7; /\* Register the window class, and if it fails quit the program \*/ if (!RegisterClassEx (&wincl)) return 0; /\* The class is registered, let's create the program\*/ hwnd = CreateWindowEx ( 0, /\* Extended possibilites for variation \*/ szClassName, /\* Classname \*/ "Window's GDI Pixel Game", /\* Title Text \*/ WS\_OVERLAPPEDWINDOW, /\* default window \*/ CW\_USEDEFAULT, /\* Windows decides the position \*/ CW\_USEDEFAULT, /\* where the window ends up on the screen \*/ 544, /\* The program's width \*/ 375,
-
Here is the source code:
#include <windows.h>
HDC hdc;
HWND hwnd;
PAINTSTRUCT ps;
bool room1 = 0;
short constupdate()
{
while(1)
{
InvalidateRect(hwnd, NULL, TRUE);
}
}
int floor;
static int x, y;
int jmpjmp = x+5;
int atpos = jmpjmp;
bool right = 1;
bool left = 0;
void first();
bool keyinroom = 1;
bool havekey = 0;
bool inmenu = 0;
/* Declare Windows procedure */
LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM);/* Make the class name into a global variable */
= "CodeBlocksWindowsApp";int WINAPI WinMain (HINSTANCE hThisInstance,
HINSTANCE hPrevInstance,
LPSTR lpszArgument,
int nCmdShow)
{
HWND hwnd; /* This is the handle for our window */
MSG messages; /* Here messages to the application are saved */
WNDCLASSEX wincl; /* Data structure for the windowclass *//\* The Window structure \*/ wincl.hInstance = hThisInstance; wincl.lpszClassName = szClassName; wincl.lpfnWndProc = WindowProcedure; /\* This function is called by windows \*/ wincl.style = CS\_DBLCLKS; /\* Catch double-clicks \*/ wincl.cbSize = sizeof (WNDCLASSEX); /\* Use default icon and mouse-pointer \*/ wincl.hIcon = LoadIcon (NULL, IDI\_APPLICATION); wincl.hIconSm = LoadIcon (NULL, IDI\_APPLICATION); wincl.hCursor = LoadCursor (NULL, IDC\_ARROW); wincl.lpszMenuName = NULL; /\* No menu \*/ wincl.cbClsExtra = 0; /\* No extra bytes after the window class \*/ wincl.cbWndExtra = 0; /\* structure or the window instance \*/ /\* Use Windows's default colour as the background of the window \*/ wincl.hbrBackground = (HBRUSH) COLOR\_BACKGROUND+7; /\* Register the window class, and if it fails quit the program \*/ if (!RegisterClassEx (&wincl)) return 0; /\* The class is registered, let's create the program\*/ hwnd = CreateWindowEx ( 0, /\* Extended possibilites for variation \*/ szClassName, /\* Classname \*/ "Window's GDI Pixel Game", /\* Title Text \*/ WS\_OVERLAPPEDWINDOW, /\* default window \*/ CW\_USEDEFAULT, /\* Windows decides the position \*/ CW\_USEDEFAULT, /\* where the window ends up on the screen \*/ 544, /\* The program's width \*/ 375,