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 - GAMINGBACON97

Pages: 1 [2] 3
16
General / Re: display variables
« on: September 07, 2015, 09:06:20 pm »
well I decided I was sick of looking at a console window, so I decided to learn SFML, I know I don't know C++ all too well, but its my first language, so please Understand I don't always know what I'm doing I understand a lot more than when I started (a few months ago).

17
General / Re: display variables
« on: September 07, 2015, 08:43:59 pm »
hey don't hate, I've only been at this stuff for a little while now, I know what I'm doing, and getting more and more stuff learned everyday, so just don't hate m8.

18
General / Re: display variables
« on: September 07, 2015, 08:36:40 pm »
ok so I  have done this, what am I doing wrong?
std::string Score_str = std::to_string(Score);
        DisplayedScore.setString(Score);//I get an error saying more than one constructo applies to
//convert int to string
 

19
General / Re: display variables
« on: September 07, 2015, 08:11:02 pm »
well, no I haven't I will though, 1 sec

20
General / Re: display variables
« on: September 07, 2015, 08:08:30 pm »
sf::Text DisplayedScore;
  std::string Score_str = std::to_string(DisplayedScore);//like this?

 

21
General / display variables
« on: September 07, 2015, 07:52:27 pm »
How would I go about displaying a variable to the string, like a score or something?

22
General / Re: somethings going wrong
« on: September 07, 2015, 07:38:02 pm »
thank you Brax, that fixed my issue

23
General / Re: Keyrepeatenabled not working
« on: September 07, 2015, 06:49:10 am »
current problem

Ok so my issue is when I change the color, I lose even if I don't touch anything
here is the code for that:
                while (MainWindow.pollEvent(Event)){
                                if (Event.type == sf::Event::KeyReleased){
                                        if (Event.key.code == sf::Keyboard::D){
                                                if (PlayerColor == Blue){
                                                        BlueScore++;
                                                        ChooseNextPlayer();
                                                }
                                                if (PlayerColor == Pink){
                                                        GameOver();
                                                }
                                        }
                                        if (Event.key.code == sf::Keyboard::A){
                                                Player.move(10, 0);
                                                if (PlayerColor == Pink){
                                                        PinkScore++;
                                                        ChooseNextPlayer();
                                                }
                                                if (PlayerColor == Blue){
                                                        GameOver();
                                                }
                                        }
                                }
void ChooseNextPlayer(){
        if (Lose == false){
                srand(time(0));
                NumberChosen = 1 + (rand() % 2);
                if (NumberChosen == 1){
                        PlayerColor = Pink;
                }
                if (NumberChosen == 2){
                        PlayerColor = Blue;
                }
                std::cout << NumberChosen << std::endl;
        }
}
 
if you need anything else of my code to help please just ask

24
General / Re: Keyrepeatenabled not working
« on: September 07, 2015, 06:39:05 am »
actually, I did some more testing, thats not the error appereantly, I'm having a different issue somewhere else in my code, I will get back to this,in about 5 minutes

25
General / Re: Keyrepeatenabled not working
« on: September 07, 2015, 06:34:38 am »
yes, as well as the sf::Keybaord::isKeyPressed(sf::Keyboard::D);

26
General / somethings going wrong
« on: September 07, 2015, 03:44:18 am »

scroll down to see the new problem


I'm having an issue where when I hold down a key it sends a bunch of things to the program saying im pressing it. so I did
MainWindow.setKeyRepeatEnabled(false);//doesn't work
while (MainWindow.pollEvent(Event)){
                                if (Event.type == sf::Event::KeyReleased){
                                        if (Event.key.code == sf::Keyboard::D){
                                                if (PlayerColor == Blue){
                                                        BlueScore++;
                                                        ChooseNextPlayer();
                                                }
                                                if (PlayerColor == Pink){
                                                        GameOver();
                                                }
                                        }
                                        if (Event.key.code == sf::Keyboard::A){
                                                if (PlayerColor == Pink){
                                                        PinkScore++;
                                                        ChooseNextPlayer();
                                                }
                                                if (PlayerColor == Blue){
                                                        GameOver();
                                                }
                                        }
                                }
//that it my code for trying to make part of a sorting game

27
General / Re: Greater than or equal to location
« on: September 05, 2015, 05:01:20 am »
Thx Hapax, with your help, and a bit of tweaking I got it working, Thx to all who helped!!!

28
General / Re: Greater than or equal to location
« on: September 05, 2015, 02:10:30 am »
I think I figured out how to get a specific coordinate, like x or y, I will post an edit once I do some more testing to see if I can close this

29
General / Re: Greater than or equal to location
« on: September 05, 2015, 02:04:22 am »
how would I go about testing a specific number using x and y? and I need it so once you drag something off to a specific direction, then it will increment a score

30
General / Greater than or equal to location
« on: September 04, 2015, 10:43:57 pm »
I'm wondering how I would find if something is farther than a certain position. here is my code:
sf::Vector2f PinkLocation=PinkPlayer.getPosition();
   if (PinkLocation >= sf::Vector2f(100, 100)){
                     //do stuff
      }
I know that it can't take the two numbers a time, but it there another way to do this?

Pages: 1 [2] 3
anything