Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


Member Since 30 Jun 2002
Offline Last Active Nov 13 2013 10:38 AM

Posts I've Made

In Topic: Critique my code please

16 August 2013 - 07:20 AM

mepis, I've sumitted a couple of pull requests that address one or two of the points I mentioned above.

In Topic: Critique my code please

15 August 2013 - 07:34 AM

  1. Every time you add a new item, you have to change the GameWindow.paint method.
  2. You have a lot of hardcoded magic numbers. Like 16666666..., (userInput == 38), (userInput == 40), etc.
  3. Some objects are not encapsulated very well. Ball is just a bag of data which doesn't do anything, just holds values. It also holds values not specific to ball, like window measurements.
  4. What is the purpose of GameLoopTimer? It looks like it could be used to make movement framerate independent, but it is not used for that. Is the frequency of GameWindow.paint calls fixed in Java, or does it vary with the speed of the machine?
  5. What is the purpose of the isHard boolean?
  6. GameWindow has too many responsibilities - drawing, input detection and response, general initialization, object creation, object movement. It should delegate a lot more to other classes. 

In Topic: Game Entity Organization

26 November 2012 - 03:17 PM

Ahhh, to me - that's a criticism sandwich! Still, tasty. Really appreciate that response, uglybdavis. I will read and digest that post. It seemed like a smell to have to implement those interfaces, so I'm glad my intuition was correct.

In Topic: Game Entity Organization

26 November 2012 - 10:15 AM

The reason for not targeting DX11 is that interoping DX11 with D2D looks like a bit of a nightmare. There was a couple hoops to jump through with 10.1, and I understand it is even worse with 11. However, I guess that once the initialization is done, I don't really need to think about it again.

Is the next-frame position of an object just assuming that the frame delta is going to be exactly the same as the current frame? That sounds... imprecise?

I have split up my entities into components - the Player is composed of a Paddle (as well as a score and other such stuff) and the Paddle is IColllidable and IDrawable. The IDrawable delegates to a RectangleDrawable, which basically adapts my Math::Rectangle to also implement IDrawable. I don't have too much problem with how they are separated, I just wonder if I've perhaps gone an indirection too far? Maybe RectangleDrawable doesn't need to be given an IRenderer to which it `describes` itself. Perhaps, instead, I could just pass in to the RectangleDrawable an ID2DRenderTarget. My obvious grip with this being that, while my game entities are unaware of DX, their components are now wedded to it. Might prevent me having to effective facade DX, though...

In Topic: Question re: pointers

16 December 2010 - 09:42 AM

Could you not return a constant reference, rather than a pointer?

My C++ is a bit rusty nowadays so apologies if this is misinformed...

class GameStructs
vector<GameStruct> StructList;
const vector<GameStruct>& GetList();

This way, you can treat the return value as a readonly value type, not a pointer, but also avoid copying all contained elements...