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

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - faizaanceg

Pages: [1]
1
Window / Re: SFML Ping Pong
« on: May 16, 2014, 04:10:27 pm »
WOW.Oh My God ! I wanna hang myself -_- That was the error. (Man...) Thanks very much for that and really sorry for such a stupid mistake :/

2
Window / Re: SFML Ping Pong
« on: May 16, 2014, 03:23:14 pm »
Hmm, sorry for the incomplete details.

Here is the GitHub link : https://github.com/faizaanceg/Ping-pong

In the handle_input function,(ping.h) is the part I posted before.


3
Window / SFML Ping Pong
« on: May 16, 2014, 01:57:09 pm »
Hey everyone,

So me and my friend are learning SFML (it's fun :p). We have just started with the basics and so we decided to make a simple Ping Pong game to test our skills. We have effectively used most simple features and now we decided to use the sf::Mouse events. Thats where the problem starts.

if(Mouse::isButtonPressed(Mouse::Left))
        {
                Vector2i  position =sf::Mouse::getPosition(*window);
               
                if(Up.contains(position))
                        playerYvel = -(SLIDER_VEL);                    
                else if(Down.contains(position))
                        playerYvel = (SLIDER_VEL);
                else
                        playerYvel=0;  
               
                 
        }              
        else
                playerYvel = 0;

The commented region is where the problem is, the Down button doesn't work at all. It doesn't get the input at all. Is it because of nested if ?

Pages: [1]