Hey guys, mind telling me what you think of my first actual game with updating of movement?
-
BUT what about the program itself? Maybe less criticizing??
andyharglesis wrote:
Maybe less criticizing??
Oh I'm sorry. I thought you wanted honest opinion from seasoned professionals. Your post title led me to assume you actually wanted our opinions. This isn't criticism, it's critique and is intended to help you grow as a developer. Trust me, I could have been harsh, but as you have made some effort I don't believe in crushing you. If you'd asked me to write the code, that would have been different. I'm not going to fire up an IDE, and copy and paste your code in just to test it - and you probably won't find anyone else here willing to do so either - especially when a cursory glance shows several areas that could be tightened up (as I explained in my previous post). I appreciate that you are young, and so are unused to dealing with people telling it to you exactly as it is, but you'd be better reading what I commented on and rewriting the code based on that - (I was coding in C long before you were born, heck I was probably coding in C when your parents were in high school). Once it's tidied up a bit, then perhaps people will be more willing to download it and try it.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
-
Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.
#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 \*/
-
Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.
#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 \*/
-
Dave. That's not very helpful for somebody who's young and just starting out. You haven't offered any constructive advice for the OP, and a lot of the replies from people have done nothing to add to the posters knowledge.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
-
Dave. That's not very helpful for somebody who's young and just starting out. You haven't offered any constructive advice for the OP, and a lot of the replies from people have done nothing to add to the posters knowledge.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
Maybe Pete, but I am not a professional developer like most here, but even I would recognise that approach as being completely sucky. And he did ask for an opinion. I gave my opinion.
------------------------------------ I will never again mention that I was the poster of the One Millionth Lounge Post, nor that it was complete drivel. Dalek Dave CCC Link[^] Trolls[^]
-
Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.
#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 \*/
Couple of suggestions for you. Best practices for programming in C[^] Standards and Style for Coding in ANSI C[^] C programming language coding guidelines[^] Applying Best Practices To Game Development[^] Game Maker "best Practices"[^]
thatraja
**My Tip/Tricks
My Dad had a Heart Attack on this day so don't...
** -
Dave. That's not very helpful for somebody who's young and just starting out. You haven't offered any constructive advice for the OP, and a lot of the replies from people have done nothing to add to the posters knowledge.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
Well done! ...and I have extensive experience writing computer code, including OIC, BTW, BRB, IMHO, LMAO, ROFL, TTYL.....
-
andyharglesis wrote:
Maybe less criticizing??
Oh I'm sorry. I thought you wanted honest opinion from seasoned professionals. Your post title led me to assume you actually wanted our opinions. This isn't criticism, it's critique and is intended to help you grow as a developer. Trust me, I could have been harsh, but as you have made some effort I don't believe in crushing you. If you'd asked me to write the code, that would have been different. I'm not going to fire up an IDE, and copy and paste your code in just to test it - and you probably won't find anyone else here willing to do so either - especially when a cursory glance shows several areas that could be tightened up (as I explained in my previous post). I appreciate that you are young, and so are unused to dealing with people telling it to you exactly as it is, but you'd be better reading what I commented on and rewriting the code based on that - (I was coding in C long before you were born, heck I was probably coding in C when your parents were in high school). Once it's tidied up a bit, then perhaps people will be more willing to download it and try it.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
Pete O'Hanlon wrote:
heck I was probably coding in C when your parents were in high school
Ouch, Pete :laugh:
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon "Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
-
Here is the source code... forgive me for the length, but I'd appreciate it if someone dared to test it.
#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 \*/
too long post ...............................
-
only 'Hall of Shame' is good place for this...
// ♫ 99 little bugs in the code, // 99 bugs in the code // We fix a bug, compile it again // 101 little bugs in the code ♫
101 little bugs in the code :laugh: