Click here to Skip to main content
15,886,049 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: MFC COM Pin
ThatsAlok1-Jun-11 20:41
ThatsAlok1-Jun-11 20:41 
QuestionAngles Pin
Cyclone_S31-May-11 14:48
Cyclone_S31-May-11 14:48 
AnswerRe: Angles Pin
Luc Pattyn31-May-11 14:59
sitebuilderLuc Pattyn31-May-11 14:59 
QuestionRe: Angles Pin
David Crow31-May-11 15:39
David Crow31-May-11 15:39 
AnswerRe: Angles Pin
Luc Pattyn31-May-11 15:50
sitebuilderLuc Pattyn31-May-11 15:50 
GeneralRe: Angles Pin
Cyclone_S5-Jun-11 16:15
Cyclone_S5-Jun-11 16:15 
AnswerRe: Angles Pin
Luc Pattyn5-Jun-11 16:26
sitebuilderLuc Pattyn5-Jun-11 16:26 
GeneralRe: Angles Pin
Cyclone_S11-Jun-11 15:38
Cyclone_S11-Jun-11 15:38 
I am using doubles in the function. The problem is I can't move the panel(ball) anything less then 1 pixel. Maybe move the ball 1pixel over a couple of frames? I'm not sure how to do that.

Here is the code.


int speed=Ball_List[b]->speed;
// Paddle center.
int paddle_center = Player->Location.X + Player->Width / 2;

// Ball center.
int ball_center = Ball_List[b]->gameBall->Location.X + Ball_List[b]->gameBall->Width / 2;

// Find the location on the paddle that the ball hit
int paddle_location = ball_center - paddle_center;

// Increase X speed according to distance from center of paddle.
double a=(90-paddle_location);
double angle = (Math::PI / 180) * a; // angle in radians.
Ball_List[b]->xVel = speed*Math::Cos(angle);
Ball_List[b]->yVel = -speed*Math::Sin(angle);

Ball_List[b]->gameBall->Top = Player->Location.Y - 16;


Thanks
AnswerRe: Angles Pin
Luc Pattyn11-Jun-11 15:49
sitebuilderLuc Pattyn11-Jun-11 15:49 
GeneralRe: Angles Pin
Cyclone_S11-Jun-11 16:28
Cyclone_S11-Jun-11 16:28 
AnswerRe: Angles Pin
Stefan_Lang31-May-11 22:51
Stefan_Lang31-May-11 22:51 
QuestionGarbage Collector vs Reference Couter Pin
Pranit Kothari31-May-11 4:53
Pranit Kothari31-May-11 4:53 
AnswerRe: Garbage Collector vs Reference Couter Pin
Chris Losinger31-May-11 4:58
professionalChris Losinger31-May-11 4:58 
AnswerRe: Garbage Collector vs Reference Couter Pin
Maximilien31-May-11 5:12
Maximilien31-May-11 5:12 
AnswerRe: Garbage Collector vs Reference Couter Pin
Nemanja Trifunovic31-May-11 6:08
Nemanja Trifunovic31-May-11 6:08 
AnswerRe: Garbage Collector vs Reference Couter Pin
Stefan_Lang1-Jun-11 0:08
Stefan_Lang1-Jun-11 0:08 
QuestionDifference between Unicode and Multibyte Pin
Pranit Kothari31-May-11 4:16
Pranit Kothari31-May-11 4:16 
AnswerRe: Difference between Unicode and Multibyte Pin
Luc Pattyn31-May-11 5:06
sitebuilderLuc Pattyn31-May-11 5:06 
GeneralRe: Difference between Unicode and Multibyte Pin
Pranit Kothari31-May-11 6:45
Pranit Kothari31-May-11 6:45 
GeneralRe: Difference between Unicode and Multibyte Pin
David Crow31-May-11 8:14
David Crow31-May-11 8:14 
AnswerRe: Difference between Unicode and Multibyte Pin
Nemanja Trifunovic31-May-11 6:11
Nemanja Trifunovic31-May-11 6:11 
GeneralRe: Difference between Unicode and Multibyte Pin
Pranit Kothari31-May-11 6:44
Pranit Kothari31-May-11 6:44 
GeneralRe: Difference between Unicode and Multibyte Pin
Nemanja Trifunovic31-May-11 8:29
Nemanja Trifunovic31-May-11 8:29 
AnswerRe: Difference between Unicode and Multibyte Pin
Richard MacCutchan31-May-11 7:40
mveRichard MacCutchan31-May-11 7:40 
AnswerRe: Difference between Unicode and Multibyte Pin
jschell31-May-11 8:26
jschell31-May-11 8:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.