looking for critique on first game.
looking for critique on first game.
so i am only to lesson 12 but wanted to try a game on my own.
I made a straight up game of pong and called it ping.
Game play
left player "w" and "s" for up and down.
right player up and down arrows
enter to start game
space bar to serve
ball speeds up every 3 hits and resets each serve
first to 10 wins
I did jump to lesson 15 first so I could get it up on GitHub.
https://github.com/CoolMoon1/Ping
it is only self commenting, I hope well enough.
I know there better ways to get this done code wise but the only thing I used not in the lessons was a switch/case for the score, my main concern is the game development ie..
I would like to know if my commits to GitHub were timed / spaced right and what order of game development might have made it easier. this is just how it fell out of my head without planning it out on paper.
all comments on code or development are welcome
Thanks for your time.
CoolMoon
I made a straight up game of pong and called it ping.
Game play
left player "w" and "s" for up and down.
right player up and down arrows
enter to start game
space bar to serve
ball speeds up every 3 hits and resets each serve
first to 10 wins
I did jump to lesson 15 first so I could get it up on GitHub.
https://github.com/CoolMoon1/Ping
it is only self commenting, I hope well enough.
I know there better ways to get this done code wise but the only thing I used not in the lessons was a switch/case for the score, my main concern is the game development ie..
I would like to know if my commits to GitHub were timed / spaced right and what order of game development might have made it easier. this is just how it fell out of my head without planning it out on paper.
all comments on code or development are welcome
Thanks for your time.
CoolMoon
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: looking for critique on first game.
My first critique would be the Ball class handling score and game over conditions.
Good use of const
I don't remember at what point chili covers constructors, but for future reference when initializing class members, it's better to use the initializer list opposed to the constructor function body like so
Not so much an issue for small applications or objects you create during application startup, but it is a good habit to get into. There are going to be times you are required to do so, and it is actually more efficient to do so.
Try to keep game logic out of your drawing routines, in Player you have clamping code in the draw function, you could move this to the Update function. Also, in your Game::ComposeFrame function
This looks like game logic, so should probably go in Game::UpdateModel
Good use of const
Code: Select all
Player::Player( int in_x, int in_y, int in_width, int in_height, int in_speed )
{
x = in_x;
y = in_y;
width = in_width;
height = in_height;
speed = in_speed;
}
Code: Select all
Player::Player( int in_x, int in_y, int in_width, int in_height, int in_speed )
:
x( in_x ),
y( in_y ),
width( in_width ),
height( in_height ),
speed( in_speed )
{}
Try to keep game logic out of your drawing routines, in Player you have clamping code in the draw function, you could move this to the Update function. Also, in your Game::ComposeFrame function
Code: Select all
if( !ball.InPlay() && wnd.kbd.KeyIsPressed( VK_SPACE ) && isStarted )
{
ball.ResetBall();
wnd.kbd.Flush();
}
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: looking for critique on first game.
Just saw something else that might be useful to you and maybe others.
In VS there is something called a Task List, by using those //ToDo or //TODO tags, you can keep track of your "TODO's". If you don't have that tab at the bottom, you can go to View / Task List to add it.
In VS there is something called a Task List, by using those //ToDo or //TODO tags, you can keep track of your "TODO's". If you don't have that tab at the bottom, you can go to View / Task List to add it.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: looking for critique on first game.
Thanks albinopapa,
all feed back is welcome. I want to start forming good habits from the start.
I will study up on the initializer list.
Also the //ToDo tip will be helpful, I found myself lost a couple of times or at least wondering what I needed to do next.
Thanks again
all feed back is welcome. I want to start forming good habits from the start.
I will study up on the initializer list.
Also the //ToDo tip will be helpful, I found myself lost a couple of times or at least wondering what I needed to do next.
Thanks again
Re: looking for critique on first game.
Looked at your code, looks like good stuff. Same comment as papa really, ball should not be responsible for score.
And I also was not aware that VS now has a todo tracker. I'll have to use that myself, maybe in a future video.
And I also was not aware that VS now has a todo tracker. I'll have to use that myself, maybe in a future video.
Chili
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: looking for critique on first game.
The only thing I don't like about the Task List is it only shows the todos when those documents are open. So if you have a bunch of todo comments in several files, you'd still have to open them up before the Task List would show the comments. Though if the file is really long, using the Task List to navigate to that comment by double clicking is nice.
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com
Re: looking for critique on first game.
has been available on vs2015 (don't remember if even earlier)
always available, always on, about ~10 years c/c++, java[script], win32/directx api, [x]html/css/php/some asp/sql experience. (all self taught)
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
Knows English, Spanish and Japanese.
[url=irc://irc.freenode.net/#pchili]irc://irc.freenode.net/#pchili[/url] [url=irc://luisr14.no-ip.org/#pchili]alt[/url] -- join up if ever want real-time help or to just chat --
-
- Posts: 4373
- Joined: February 28th, 2013, 3:23 am
- Location: Oklahoma, United States
Re: looking for critique on first game.
Yeah, if I remember correctly, VS2013 had it and had more options like User Tasks which allowed you to add a task list and check them off as you completed them. It was removed in VS 2015 though.
Visual Studio Task Lisk
Visual Studio Task Lisk
If you think paging some data from disk into RAM is slow, try paging it into a simian cerebrum over a pair of optical nerves. - gameprogrammingpatterns.com