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

Pages: [1]
1
Graphics / Incrementing a number in a sf::String?
« on: October 17, 2010, 12:27:08 pm »
Just create a simple string converter class, like this:
Code: [Select]

#include <sstream>

class StringConverter
{
public:

static int toInt(const std::string& str)
{
std::istringstream stream(str);
int value;
stream >> value;
return value;
}

static std::string toString(int value)
{
std::ostringstream stream;
stream << value;
return stream.str();
}
};


and an example how to use it:
Code: [Select]

int health = 100;
sf::String Text("Health: " + StringConverter::toString(health));

2
SFML projects / Tetris Clone
« on: September 03, 2010, 05:54:21 pm »
Thanks!

I wrote a simple button class for main menu.

3
SFML projects / Tetris Clone
« on: August 26, 2010, 05:43:50 pm »
Hi everyone!

I have just finished my firts game with C++ and SFML. It's a simple Tetris clone.



Controls:
Left/Right key: rotate block
Down key: faster drop
ESC: pause game

Download:
http://www.mediafire.com/?6pucl2v93n55omt

Pages: [1]
anything