Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: != symbol error with sf::CircleShape  (Read 3461 times)

0 Members and 1 Guest are viewing this topic.

oOhttpOo

  • Newbie
  • *
  • Posts: 40
    • View Profile
!= symbol error with sf::CircleShape
« on: April 22, 2015, 08:37:09 pm »
Can someone help me with points of a sprite? I am trying to make a sprite move when it intersects another's bounding box, but my code should be pretty much self explanitory on what im trying to do. I want the sprite to 'glide' or move smoothly in steps of 50 or less. How would I get the "not equal" bit right?
       
if (ball.getGlobalBounds().intersects(paddle1.getGlobalBounds()))
                {
                        while (ball.getGlobalBounds != (400, -260)){
                ball.move(20, 0);
               
                             }
 

Rosme

  • Full Member
  • ***
  • Posts: 169
  • Proud member of the shoe club
    • View Profile
    • Code-Concept
Re: != symbol error with sf::CircleShape
« Reply #1 on: April 22, 2015, 09:31:34 pm »
Actually, your code doesn't make sense and don't compile. You might want to take a good book of C++ before making game in case you lack some basic knowledge. Always a good thing to get a refresh.

Also, you might want to read this and provide errors if there is any.
GitHub
Code Concept
Twitter
Rosme on IRC/Discord

shadowmouse

  • Sr. Member
  • ****
  • Posts: 302
    • View Profile
Re: != symbol error with sf::CircleShape
« Reply #2 on: April 22, 2015, 09:33:49 pm »
Try:
Code: [Select]
while(ball.getGlobalBounds().x != 400 || ball.getGlobalBounds().y != -260){
or (I think)
Code: [Select]
while(ball.getGlobalBounds() != sf::FloatRect(400,-260)){

oOhttpOo

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: != symbol error with sf::CircleShape
« Reply #3 on: April 22, 2015, 09:47:02 pm »
thanks shadowmouse :)

 

anything