SFML community forums

Help => Graphics => Topic started by: oOhttpOo on April 22, 2015, 08:37:09 pm

Title: != symbol error with sf::CircleShape
Post by: oOhttpOo 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);
               
                             }
 
Title: Re: != symbol error with sf::CircleShape
Post by: Rosme 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 (http://en.sfml-dev.org/forums/index.php?topic=5559.0) and provide errors if there is any.
Title: Re: != symbol error with sf::CircleShape
Post by: shadowmouse 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)){
Title: Re: != symbol error with sf::CircleShape
Post by: oOhttpOo on April 22, 2015, 09:47:02 pm
thanks shadowmouse :)