« first day (106 days earlier)      last day (2752 days later) » 

2:27 PM
Hey man I'm trying to get my ball to properly bounce off my paddle. It works most of the time except when the ball hits the bottom or top wall and collides with the bottom or top side of the paddle. So I would like to how I can refine my deflecting function. Here are the relevant functions that detects collision and deflects the ball paste.ofcode.org/Hmkr4QeAmSNjjzQvBckVM4 If you see anything you don't understand, just ask.
 
fix the xDirection depending on the position of the paddle (left or right), that'll avoid the ball getting stuck inside the paddle
 
you mean the xVelocity variable right?
 
2:50 PM
yeah
 
 
8 hours later…
10:52 PM
I have a Design Pattern question....
If I use of a Layout manager for implementing different ways for placing the components or laying-out these components inside a graphics container which contains other graphic components. Is this in Iterator Pattern or Composite?
 
2 messages moved from Lounge<C++>
@Rick Hehe. I'd call it a strategy. And the UI element tree would be composite.
 
But as a whole would it be strategy more so?
 
You described too many things. As a whole, it would be program logic.
> different ways for placing the components or laying-out these components
That's a strategy thing
> components inside a graphics container which contains other graphic components
That's a composite thing
Note I expressly avoid "religious" pattern terminology. It's overrated.
 
11:18 PM
Is it the Facade Design Pattern that allows the creation of an arbitrary hierarchical structure where each member of the structure is composed of members which are themselves either aggregates, or simple objects which contain no aggregate objects, and where the structure hierarchy can be navigated and the visited objects operated-upon through a common interface?
 

« first day (106 days earlier)      last day (2752 days later) »