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

Pages: [1]
1
General / Exporting an SFML Project in Code::Blocks
« on: February 08, 2012, 02:54:16 pm »
That's great thanks very much!

2
General / Undefined reference to '__dyn_tls_init_callback'
« on: February 08, 2012, 12:55:26 pm »
Hi

I have been running this program for a while now and have had adjust the compiler and debug settings so that I could transport it from uni to home and still make it work, which it wasn't doing before.

It worked for a little while and now it is not liking it and not sure why?

This is what I have:

Settings>Compiler and debugger settings>Search directories>Compiler

G:\Year 3\Undergrad Project\Dissertation_Version1.2\SFML\SFML-1.6
G:\Year 3\Undergrad Project\Dissertation_Version1.2\SFML\SFML-1.6\include
G:\Year 3\Undergrad Project\Dissertation_Version1.2\SFML\MinGW\include
G:\Year 3\Undergrad Project\Dissertation_Version1.2\SFML\MinGW\lib
G:\Year 3\Undergrad Project\Dissertation_Version1.2\SFML\SFML-1.6\include\SFML


and in linker (Settings>Compiler and debugger settings>Search directories>Linker)

G:\Year 3\Undergrad Project\Dissertation_Version1.2\SFML\SFML-1.6\lib
G:\Year 3\Undergrad Project\Dissertation_Version1.2\SFML\MinGW\lib

(SFML-1.6 is the folder which was downloaded from the sfml website and extracted)

Any ideas? I look forward to your replies

3
General / Exporting an SFML Project in Code::Blocks
« on: February 03, 2012, 11:01:43 am »
I thought that was how it was supposed to work, I began doubting myself with the errors that would appear on screen...

//First error before adding the file to the directory
"The program can't start because libgcc_s_dw2-1.dll is missing"

//Add the file to the bin>Debug folder
"The program can't start because libstdc++-6.dll is missing"

//After adding the file different error shows
"The procedure entry point _ZTVN10_cxxabiv117_class_type_infoE could not be located in the dynamic link library libstdc++-6.dll"

What am I missing?

4
General / pretty sure I set something up wrong.....again
« on: February 03, 2012, 02:01:42 am »
Hi

Don't quote me on this as I am new to SFML myself but I have had that problem before. Unfortunately, the only way I got around it was by coping everything into a new project and compiled it and it appeared to work fine. That is probably the most inefficient way of doing it but it did work for me.

Just to check, you have the files that it requires where the .exe file is, not just in the project directory? That caused lots of problems for me to begin with.

Hope it helps.

Melissa

5
General / Exporting an SFML Project in Code::Blocks
« on: February 03, 2012, 01:03:02 am »
All I need it to do is to display the command line and a render window for the game to play on, if that's what you mean. I wouldn't require to touch the code at all whilst I'm at uni, except to view a text file that it saves the data to each time it is played, but even then only to read not edit.

If it helps I am using SFML 1.6

6
General / Exporting an SFML Project in Code::Blocks
« on: February 02, 2012, 08:24:26 pm »
Hi all

For my dissertation, I need the program I have created (using Code::Blocks with SFML) to work on computers at Uni, which currently don't have SFML installed. Is there a way of taking everything I have in the project directory and make it like an application that can be run without needing the SFML part?

If it helps I am have created three files within the project on top of the SFML files etc.

Kind Regards

Melissa

7
System / Clock::GetElapsedTime() error in my code
« on: January 08, 2012, 09:52:44 am »
Ok that's great I'll do both of those thanks very much!

8
System / Clock::GetElapsedTime() error in my code
« on: January 07, 2012, 10:35:20 pm »
Hi

I apologise for my ignorance with using SFML, I have been using it for 2 weeks as I want to learn a new piece of software with my dissertation.

My aim is to create a timer which monitors the time that has elapsed since its last reset. The user will need to click an enemy to increase their score before the timer has reached five seconds. If the timer reaches five seconds then set the enemy position to another random place on the screen.

I am using an enum to determine what the game state is currently in, whether it is in 'Playing', 'Exiting' or 'Uninitialised' which determines what is happening in the game as the entire game works around one main function 'gameLoop'.

My problem is if I use cout to display the elapsed time it displays the time like 0.000843478 and doesn't appear to increase, it appears to be a random sequence of numbers that never reaches 0.001.

Any ideas? This is my gameLoop function:

Code: [Select]

void GameClass::gameLoop()
{
sf::Event currentEvent; //Creates an instance of sf Event called currentEvent which will monitor the gameState whilst the program is running
gameWindow.GetEvent(currentEvent); //Assigns the currentEvent to gameWindow

switch(gameState) //Monitors the changes within gameState and applies the appropriate implementation depending on the cases below
{
case GameClass::Playing: //Alter the game environment so that all sprites are drawn to stage ready for the user to play
{
sf::Clock enemyClock;
            bool enemyHit = false;
while((enemyClock.GetElapsedTime()<5.f)&&(enemyHit == false))
{
   gameWindow.Clear(sf::Color(0,0,0)); //Clears all images off screen and reverts it to a black screen
                enemy.drawCharacter(gameWindow);
                player.drawCharacter(gameWindow);
                gameWindow.Display();
                cout<<"Time: "<<enemyClock.GetElapsedTime()<<endl;
                if(currentEvent.Type == sf::Event::Closed)
                {
                    gameState = GameClass::Exiting; //If the 'X' button is closed on the gameWindow then the gameState changes to Exiting
                }

                switch(currentEvent.Type)
                {
                    case sf::Event::MouseButtonPressed:
                        switch (currentEvent.MouseButton.Button)
                        {
                            case sf::Mouse::Left:
                                {
                                    player.setIsFiringStatus(true);
                                    player.fireWeapon();
                                    //Debug to test if enemy is being hit
                                    int enemyX = enemy.enemySprite.GetPosition().x;
                                    int enemyY = enemy.enemySprite.GetPosition().y;
                                    int playerX = player.userCursor.GetPosition().x;
                                    int playerY = player.userCursor.GetPosition().y;

                                        if(((((enemyX - playerX)>0)&&(enemyX - playerX)<30)&&((enemyY - playerY)>0)&&(enemyY - playerY)<30)||((((playerX - enemyX)>0)&&(playerX - enemyX)<30)&&(((playerY - enemyY)>0)&&(playerY - enemyY)<30)))
                                        {
                                            enemyHit = true;
                                            cout<<"Enemy hit"<<endl;
                                            break;
                                            //enemy.setEnemyPosition();
                                        }

                                    player.setIsFiringStatus(false);
                                    break;
                                }
                            default:
                                break;
                        }
                        break;
                    case sf::Event::MouseButtonReleased:
                        //cout<<"Mouse button released"<<endl;
                        break;
                    case sf::Event::MouseMoved:
                    {
                        //Need to update the position of the mouse/cursor sprite
                        player.userCursor.SetPosition((currentEvent.MouseMove.X), (currentEvent.MouseMove.Y));
                        break;
                    }
                    default:
                        break;
                }

                    break;
                }
                if(enemyHit)
                {
                    player.addToUserScore(100);
                    cout<<"Score: "<<player.getUserScore()<<endl;
                    enemy.setEnemyPosition();
                    //enemyClock.Reset();
                }
                /*if(enemyClock.GetElapsedTime()>5.f)
                {
                    enemy.setEnemyPosition();

                }*/


}
default: //Prevents warnings
break;
}
}

Pages: [1]