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.


Topics - Shriek

Pages: [1]
1
General / Why does my program suddenly stop working?
« on: August 15, 2011, 01:00:24 pm »
Hey guys I'm trying to make a 2d rpg, the world is split into 40x40 tiles which can be viewed on the map and each individual area is made of 201x201 tiles. When I run my code it sets the images and positions for the map tiles but when i tell it to set the images and positions for my area tiles it gets to the while loop, looks at it and thinks like "hmmm nah i'm not gonna run that" and then it just stops with 'The thread 'Win32 Thread' (0x454) has exited with code 0 (0x0).'

Here is the code it stops at:

Code: [Select]

std::vector< std::vector<sf::Sprite> > SpTiles(201,
std::vector<sf::Sprite>(201));

iX = 0;
iY = 0;
fX = 0.f;
fY = 0.f;
        // Program stops here
while (iY < 201);
{
SpTiles[iX][iY].SetImage(ImGrass);
SpTiles[iX][iY].SetPosition(fX, fY);
++iX;
fX = fX + 64.f;
if (iX > 200)
{
iX = 0;
++iY;
fX = 0.f;
fY = fY + 64.f;
}
}

2
Graphics / Need help with tutorial
« on: July 08, 2011, 01:14:12 pm »
Hi guys I've gone through the tutorial "Graphics - Using render windows" and I tried to make one but it won't work, I get 9 errors all saying parts of code are referenced in function_main, here is the code:

Code: [Select]

#include <SFML/System.hpp>
#include <SFML/Graphics.hpp>
#include <iostream>

int main()
{
    // Create the main rendering window
    sf::RenderWindow App(sf::VideoMode(800, 600, 32), "SFML Graphics");
   
    // Start game loop
    while (App.IsOpened())
    {
        // Process events
        sf::Event Event;
        while (App.GetEvent(Event))
        {
            // Close window : exit
            if (Event.Type == sf::Event::Closed)
                App.Close();
        }

        // Clear the screen (fill it with black color)
        App.Clear();

        // Display window contents on screen
        App.Display();
    }

    return EXIT_SUCCESS;
}


It's just a copy paste from the tutorial except the #includes and I have linked the sfml-system.lib.

Pages: [1]