Jump to content

  • Log In with Google      Sign In   
  • Create Account

We need your feedback on a survey! Each completed response supports our community and gives you a chance to win a $25 Amazon gift card!


chilun

Member Since 10 Oct 2013
Offline Last Active Nov 29 2013 12:09 PM

Posts I've Made

In Topic: C++ OPENGL help wanted to port glbegin and end

01 November 2013 - 04:18 PM

thanks very much. I'll look into this


In Topic: opengl glutstrokecharacter - write text to screen

31 October 2013 - 05:16 AM

Thank you very much. There is an alternative using the GlutBitmapCharacter function so I will test to see if this works with my existing code instead.


In Topic: opengl help wanted to set background picture

29 October 2013 - 02:33 AM

Thank you very much for the links. I'll take a closer look at these


In Topic: glortho function - assistance required...

28 October 2013 - 05:19 PM

Hi Goran;

 

I'll definitely try what you suggested and will come back to you with a response.

 

Thank you very much indeed :)


In Topic: collision detection help for Pong game in C++

11 October 2013 - 04:28 AM

I've figured this out...

Split the conditional statement into 2 in order to handle with the paddle - wall contact (prevent the paddle flying off) and also modified the maxVelocity value to 500.0f. 

This now works for me biggrin.png

 

Thanks everyone for your help.

Chilun

 

...

 
sf::Vector2f pos = this->GetPosition();
 
// MAKE SURE PADDLE DOESN'T DISAPPEAR OFF INTO SPACE WHEN IT REACHES THE WINDOW BOUNDARY (LEFT AND RIGHT SIDE)
if(pos.x  < GetSprite().GetSize().x/2) {
this->SetPosition(GetSprite().GetSize().x/2, this->GetPosition().y);
}
if(pos.x > (Game::SCREEN_WIDTH - GetSprite().GetSize().x/2)){
this->SetPosition(Game::SCREEN_WIDTH - GetSprite().GetSize().x/2, this->GetPosition().y);
}

PARTNERS