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

Pages: [1]
1
SFML projects / Re: Black Knight Blockade (Minigame)
« on: December 17, 2012, 08:03:18 pm »
Very cool game! I really liked it. The sword slashing was kind of odd though. Something that would have been really cool is to make the sword slashing like in the old 8-bit zelda games (like Link's Awakening). That would probably make it look a lot better.

2
SFML projects / Slide Them Boxes (2d puzzle-game)
« on: February 16, 2012, 08:44:19 am »
Cool game! I see you're eading the level designs from some .png images. How did you do that?

3
Graphics / Lag problem
« on: December 21, 2011, 11:47:26 am »
I fixed it. All I had to do was to update the driver for my graphics card.

4
Graphics / Printing Variables
« on: December 20, 2011, 11:04:12 pm »
If your compiler supports C++11, you can simply use the to_string function.

5
Graphics / Lag problem
« on: December 20, 2011, 06:47:59 pm »
I am making a car game which currently has three sprites: the background, moving road lines, and the car. If I draw just the road lines and the car, and not the background, everything runs smooth. But when I draw the background, everythings starts to lag. I did a check, and it only loops through the main game loop 10 times per second when the background is drawn, but around 100 when it's not. Just simply commenting out App.Draw(Background); fixes the problem, but this is of course not an option. The background is a 800x600 .png file. Anyone has an idea why this is happening? Thanks in advance.

6
SFML projects / Falling Rocks! (demo inside)
« on: December 05, 2011, 07:55:37 pm »
Really awesome game! I'm addicted to it already.

7
Window / String keyboard input
« on: April 22, 2011, 09:44:12 pm »
Like:
Code: [Select]
int number;
cin >> number;

8
Window / String keyboard input
« on: April 22, 2011, 09:02:46 pm »
Thanks! Is there a way to directly assign a varible through keyboard input?

9
Window / String keyboard input
« on: April 22, 2011, 06:51:43 pm »
Is there a way to input a string from the keyboard from a window, for example; "hello", like 'cin' in the standard library?

10
Graphics / Sprite copy constructor
« on: April 21, 2011, 08:26:12 pm »
Hello everyone! I've been using SFML for a few days, and when reading the tutorial about sprites, I came across this code snippet:

Code: [Select]
class MyPicture
{
public :

    // This is the copy constructor
    MyPicture(const MyPicture& Copy) : Image(Copy.Image), Sprite(Copy.Sprite)
    {
        // This is the trick : we setup the sprite
        // to use our image, instead of the one of Copy
        Sprite.SetImage(Image);
    }

    // ... a lot of useful functions ...

private :

    sf::Image  Image;
    sf::Sprite Sprite;
};


The problem is just that I have no idea how to use it, and the tutorial doesn't explain it very well. I'm not too good with classes either, but I know how to use them. Any help would be greatly appreciated. I would also really appreciate if someone could post an example code using this copy constructor. Maybe that would help me understand it a little bit more. Thanks.

11
General discussions / SFML and Box2D
« on: April 19, 2011, 05:43:57 pm »
Aah, I see. Thanks :)

12
General discussions / SFML and Box2D
« on: April 19, 2011, 05:07:13 pm »
Why are people using both SFML and Box2D? What do they benefit from it?

13
System / Pause for input and displaying values
« on: April 19, 2011, 04:57:27 pm »
I found some code for a header file that could convert a variable to a std::string, so after that I just assigned that string it to a sf::String. Thanks for the help!

14
System / Pause for input and displaying values
« on: April 19, 2011, 04:00:25 pm »
Thanks for answering! The way you did the "wait" program was actually how I did it too :P. I were just wondering if there was an easier way. But I still can't seem to solve the problem with displaying values. I've read the link you posted several times. I've also tried to just put value instead of "text", for example:
Code: [Select]
int value = 5;
sf::String val(value);

But this doesn't work. :/

15
System / Pause for input and displaying values
« on: April 18, 2011, 09:00:50 pm »
Hello everyone! I'm pretty new to SFML (started about 3 days ago), and I really like it so far! Though there's two problems I can't seem to solve. I've tried to google them, but found no results. My first question is: How do I make the program stop/pause completely until the user for example presses a key? (Like the _getch() function from the conio.h header). My second question is: How do I display a value? For example; int value = 5. How do I display "value" to the window? Any help would be greatly appreciated :)

Pages: [1]