Ok, here is a part of the game code
you can download the two images ( background and character ) from mediafire
http://www.mediafire.com/?9iiwjt6n6ij5jmisorry it's too big for the attachment : )
also I can upload a video on youtube to show you the problem
I'm using Visual C++ 2008, and I'am using dynamic linking
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(900, 550), "SFML works!");
sf::Sprite spriteBg;
sf::Sprite spriteHero;
sf::RectangleShape Rect;
sf::Text heroText("Get of my face ... ");
sf::Text instText("Press 'Space' to speak with people, 'Z' or 'X' to rotate \n and arrows to move");
sf::Text anonyText("?");
sf::Image heroCharCK;
sf::Texture background;
sf::Texture heroChar;
if(!heroCharCK.loadFromFile("heroChar.png")) {
return EXIT_FAILURE;
}
heroCharCK.createMaskFromColor(sf::Color(255, 255, 255), 0);
if(!background.loadFromFile("background.png")) {
return EXIT_FAILURE;
}
if(!heroChar.loadFromImage(heroCharCK)) {
return EXIT_FAILURE;
}
spriteBg.setTexture(background);
spriteBg.setPosition(1.0f, 1.0f);
spriteHero.setTexture(heroChar);
spriteHero.setTextureRect(sf::IntRect(0, 0, 32, 32));
spriteHero.setPosition(600.0f, 200.0f);
Rect.setSize(sf::Vector2f(40, 70));
Rect.setFillColor(sf::Color(41, 14, 152, 200));
Rect.setPosition(100, 100);
heroText.setPosition(spriteHero.getPosition().x + 32, spriteHero.getPosition().y);
heroText.setCharacterSize(15);
heroText.setStyle(sf::Text::Bold);
instText.setPosition(200, 0);
instText.setCharacterSize(15);
instText.setStyle(sf::Text::Bold);
while (window.isOpen()) {
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) {
Rect.move(-3, 0);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) {
Rect.move(3, 0);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) {
Rect.move(0, -3);
}
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) {
Rect.move(0, 3);
}
window.clear();
window.draw(spriteBg);
window.draw(spriteHero);
window.draw(Rect);
window.draw(heroText);
window.draw(instText);
window.draw(anonyText);
window.display();
}
return EXIT_SUCCESS;
}