• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
Crusable77

Peer review of some sort.

3 posts in this topic

Hello, I just finished my first game, a pong clone and It would be awesome if someone( or more) could review my code and design choice. There are some known issues such as the collision, when the ball hits the top or bottom of the players paddle it will disappear or rattle around and get spit out. If this happens to the enemy then the ball will get stuck inside. Also, the AI is very bad, as far I I have seen, the AI will never lose. Lastly, there is no sound or text, however there is a working score system, you just don't know the score unless you count. I will probably fix these in the next day or so. The reason I would like the peer review is because if I am making big mistakes, or using bad programming practices  they can be fixed asap. I have included a link to the project with working exe's (they work on my PC, windows 7 laptop) however if you are not comfortable downloading the files, pm me and I will just put them in chat. Thank you in advance for any help.

 

Link: https://docs.google.com/file/d/0BzAXLewFU0RnTzJFaG5CNkFVRTA/edit?usp=sharing

0

Share this post


Link to post
Share on other sites

I had a quick squiz and these are parts that imo need fixing:

 

  1. Your game class has static values for some reason when they could in fact be given in the constructor (Screen width, height, bpp and max fps).
    1. You could then also load those values from an ini file or something to stop having any kind of magic numbers
  2. You aren't dealing with the fact that your game might run at an fps lower or higher than 60. Have a look at delta time in regards to games or physics simulations or if you want something more advanced google Fix your timestep.
  3. You are manually calling move and draw on your entities, what if you wanted multiple balls in the game? Have a generic update and draw method which entities can implement and just loop through them calling those two methods.
  4. All entities have a score, I don't know why. Should be in your game class or in a paddle class.
  5. You are using a string to decide between a ball and paddle in your base entity class. I don't think that's the best way, you could have something like Entity->MoveableEntity->ChaseObjectEntity. (I start making things complicated here...)
    1. You could also then have a Controllable->PlayerController and AIController. That way you could have an ai controller attached to a paddle class so two AI's could vs eachother or have EasyAI and HardAI controllers.
    2. Plus a Collidable class where collidables are inside the collision class and all get looped through and checked for collisions, the ball would reverse it's velocity on collision. Collidables would need an OnCollision function.
  6. You need to make sure you keep to the same naming convention (KeyState and Collid vs mPlayer etc)

 

Well...I got a little carried away and this seems a little overkill for this game but it would make it more generic and give you the ability to add more things easier! Something I did like was the simplicity of your code it all does what it needs which is fine, remember that!

 

 

0

Share this post


Link to post
Share on other sites

Something that'd make life easier for sharing code like this would be GitHub; it'd also mean you wouldn't need anyone to worry about mentally filtering out object files or generated executables. But that's completely off topic.

 

It's nice to see somewhat consistent formatting. Definitely a great start.

 

Only thing I can really see is the use of the 'TYPE' enumeration in 'entity.h'. You've tied the entity class quite heavily to it but you've kept the enumeration outside of the class. I'd recommend putting the definition of the enumeration as a public member of the class. It means if you copied the class you'd not accidently forget about including it.

 

EDIT: Also, Bjarne Stroustrup recommends making base classes take care of themselves. You've provided an interface for tracking member changes but you've also made all the members 'protected' giving derived classes access anyway. Make them private and force access through through functions; at least that way you can enforce value ranges, etc in an easier fashion.
 

Edited by BinaryPhysics
1

Share this post


Link to post
Share on other sites

The enum Type in entity class is a mistake, for some reason I decided not to do that and I forgot to remove it apparently. Thanks for the feedback.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0