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 - 33pwnt33

Pages: [1]
1
General / Re: problem with executing
« on: May 11, 2013, 06:48:09 pm »
Here is an example of what the code looks like.

[attachment deleted by admin]

2
General / Re: problem with executing
« on: May 11, 2013, 06:45:25 pm »
Hey croux,
There is not a problem at all with your code so there was no need to post it.  I think it is a problem with the linker.  Using Visual Studio myself I never have problems like this but I think instead of
Quote
g++ -o m.exe main.cpp -lsfml-graphics -lsfml-window -lsfml-system
you should try:


g++ -o m.exe main.cpp -lsfml-graphics.lib -lsfml-window.lib -lsfml-system.lib.


It is just I guess but give it a shot.

By the way you don't need sfml-system

3
Graphics / Re: Screen Capture Issue
« on: May 04, 2013, 08:33:54 pm »
Thanks soooooo much for the reply, I will use that method!

4
Graphics / [SOLVED] Screen Capture Issue
« on: May 04, 2013, 07:50:40 pm »
Okay I know with sfml you can screen capture:
sf::RenderWindow Screen;
Screen.capture();
What I don't know is how to capture the whole entire screen and not just the application and how to save the screen capture to a file.

5
General / Re: SFML Game.exe has stopped working.
« on: April 30, 2013, 04:32:25 am »
Sorry guys, I solved the problem on my own.  I had pasted the code in visual studio 2010 instead of 2012 and compiled in debug.  After that I tried release (which didn't work).  But I noticed what had happened wasthat everything I linked in debug was not linked in release.

6
General / Re: SFML Game.exe has stopped working.
« on: April 27, 2013, 10:42:24 pm »
Thanks for the response but the program still crashes when I open it.  The program works in debug mode but I want to compile it in release mode.

7
General / [Solved] SFML Game.exe has stopped working.
« on: April 27, 2013, 10:22:07 pm »
I don't think there is anything wrong with my code, because when I compile in visual studio express 2012 (release mode) there are no errors.  Though when I try too open the application it says: "SFML Game.exe has stopped working".

Here is my code:
#include <SFML\Graphics.hpp>
#include <Windows.h>
#include <iostream>

//Variables
bool appon,collision;
int PlayerX,PlayerY,speed;

sf::RenderWindow wind(sf::VideoMode(800, 600), "PwntGame");
sf::CircleShape Player(20.f);
sf::RectangleShape Object1(sf::Vector2f(100, 100));
sf::RectangleShape Object2(sf::Vector2f(100, 100));

int main()
{
        using namespace std;
        appon = true;
        speed = 25;

        PlayerX = 380;
        PlayerY = 280;

        collision = true;

        //Initialize Objects
        Object1.setFillColor(sf::Color::Blue);
        Object1.setPosition(100, 100);

        Object2.setFillColor(sf::Color::Blue);
        Object2.setPosition(300, 100);
       
        while(appon)
        {
                Sleep(speed);

                //If Escape Key down
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::Escape)){
                        wind.close();
                        Sleep(1000);
                        system("cls");
                        cout<<endl<<"Shutting down"<<endl;
                        Sleep(500);
                        appon = false;
                }

                //If Slash key down
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::Slash)){
                        cout<<"0010101110101010101";
                        cout<<"1010001010111010111";
                        cout<<"1010101011101010010";
                }

                //Collision
                if(collision){
                if(PlayerY == 200 && PlayerX>60 && PlayerX<200){PlayerY = PlayerY = 201;cout<<"SHIFT + C to toggle collision"<<endl;}
                if(PlayerY == 60 && PlayerX>60 && PlayerX<200){PlayerY = PlayerY = 59;cout<<"SHIFT + C to toggle collision"<<endl;}
                if(PlayerX == 60 && PlayerY>60 && PlayerY<200){PlayerX = PlayerX = 59;cout<<"SHIFT + C to toggle collision"<<endl;}
                if(PlayerX == 200 && PlayerY>60 && PlayerY<200){PlayerX = PlayerX = 201;cout<<"SHIFT + C to toggle collision"<<endl;}

                if(PlayerY == 200 && PlayerX>260 && PlayerX<400){PlayerY = PlayerY = 201;cout<<"SHIFT + C to toggle collision"<<endl;}
                if(PlayerY == 60 && PlayerX>260 && PlayerX<400){PlayerY = PlayerY = 59;cout<<"SHIFT + C to toggle collision"<<endl;}
                if(PlayerX == 400 && PlayerY>60 && PlayerY<200){PlayerX = PlayerX = 401;cout<<"SHIFT + C to toggle collision"<<endl;}
                if(PlayerX == 260 && PlayerY>60 && PlayerY<200){PlayerX = PlayerX = 259;cout<<"SHIFT + C to toggle collision"<<endl;}

                if(PlayerX<1){PlayerX = 1;cout<<"You Are Not Permited in This Area"<<endl;}
                if(PlayerY<1){PlayerY = 1;cout<<"You Are Not Permited in This Area"<<endl;}
                if(PlayerX>759){PlayerX = 759;cout<<"You Are Not Permited in This Area"<<endl;}
                if(PlayerY>559){PlayerY = 559;cout<<"You Are Not Permited in This Area"<<endl;}
                }

                //Keydowns
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::A)){PlayerX = PlayerX-1;}
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::S)){PlayerY = PlayerY+1;}
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::D)){PlayerX = PlayerX+1;}
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::W)){PlayerY = PlayerY-1;}
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::O)){speed = speed-1;}
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::P)){speed = speed+1;}
                if(sf::Keyboard::isKeyPressed(sf::Keyboard::LShift) && sf::Keyboard::isKeyPressed(sf::Keyboard::C) || sf::Keyboard::isKeyPressed(sf::Keyboard::RShift) && sf::Keyboard::isKeyPressed(sf::Keyboard::C)){
                        Sleep(500);
                        if(collision){
                                collision = false;
                        }
                        else{
                                collision = true;
                        }
                }

                if(speed>50){speed = 47;}
                if(speed<5){speed = 8;}

                //Player stuff

                Player.setPosition(PlayerX, PlayerY);
                Player.setFillColor(sf::Color::Red);

                //Draw Everything
                wind.clear();
                wind.draw(Player);
                wind.draw(Object1);
                wind.draw(Object2);
                wind.display();
        }
    return 0;
}

Pages: [1]