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

Pages: [1] 2 3
1
General discussions / State machines or Screens?
« on: October 25, 2011, 12:56:17 pm »
In my state machine there are two ways to change state:

1) Push the new state onto the state stack
2) Change the top state on the state (basically a pop followed by a push)

That way you can have the main menu push the play state onto the stack, and when the game ends and the play state gets poped, you'll automatically get back to the main menu.

You can also eg. have a paused game state. When resume the game again, the paused state gets poped and you're back in the game again.

When the player selects "Quit" from the main menu, the menu state gets poped, and since there are no more states on the stack, the game ends.

2
General discussions / State machines or Screens?
« on: October 21, 2011, 10:53:55 am »
In my state machine each state creates whatever state to come next. Eg. MainMenuState creates a PlayGameState and push it on the state stack when the player hits "Play". And PlayGameState creates a GameOverState. That way the main menu can insert the player name in the PlayGameState class. And PlayGameState can insert the final score in the GameOverState class.

3
Window / Multiple mice?
« on: August 07, 2011, 12:18:18 pm »
Quote from: "thePyro_13"
How would multiple mice function? Both of them sharing control of the same cursor and buttons, or as two separate cursors with their own unique mouse buttons?


Personally, I've got an idea for a game that requires two mice controlling separate cursors.

4
General / MapLoader like in Slick for TILED?
« on: July 06, 2011, 01:34:21 pm »

5
System / DeltaTime question
« on: June 28, 2011, 08:09:48 am »
GetFrameTime() returns the time since the last frame, not since program start. If you want to move the sprite you'll have to increase the position every frame:
Code: [Select]
moveVector.x += 10.f * deltaTime;

6
Window / Manage multiple screens in a game
« on: June 14, 2011, 07:42:27 am »
I suggest you have a look at this wiki article: https://github.com/SFML/SFML/wiki/TutorialScreens.

7
Graphics / image.LoadFromFile( "Logo.tga" ) - Fails
« on: October 25, 2010, 07:43:57 pm »
What IDE are you using?

Try putting the file in the same directory as the executable.

8
General / Crash at app run
« on: October 19, 2010, 11:26:47 am »
Here's an old post with compiled SFML2 libs: http://www.sfml-dev.org/forum/viewtopic.php?t=2909

9
General / Crash at app run
« on: October 17, 2010, 11:17:22 am »
I don't think it's a 64-bit problem. I'm running Win7 64 bit and VS2010 and I use SFML2 without a problem. I had no trouble building the libs myself. I just loaded the VS2008 solution, converted it and selected batch build.

10
General / Crash at app run
« on: October 13, 2010, 08:18:48 pm »
If you copied them from your friend they're probably correct.

11
General / Crash at app run
« on: October 13, 2010, 12:21:58 pm »
Have you checked that you're using the correct DDL files?

12
General / Crash at app run
« on: October 13, 2010, 07:33:29 am »
Have you tried using the same project file as your friend?

13
General / Incrementing a variable when pushing a button
« on: October 05, 2010, 07:32:27 am »
The problem might be the for loop where you draw the bullets. Try changing the condition to i < numberofbullets.

14
SFML projects / MotoGT - open source motorcycle racing game
« on: October 04, 2010, 07:49:43 pm »
It looks fantastic! I really like the menus. Some shadows under the bikes would be nice though.

15
Window / Re: Problem trying setup and draw window using multiple file
« on: October 04, 2010, 07:42:29 pm »
Quote from: "Sam42"

void MyEngine::Init(int height, int width)
{
    sf::RenderWindow App(sf::VideoMode(height, width, 32), "MyEngine");
    App.SetActive();
    App.SetFramerateLimit(60);
    m_running = true;
}

You don't mention what's not working, but I guess the above code is the problem. The first line in MyEngine::Init() creates a new variable App that's local to that function. Instead of creating a new variable, use MyEngine::App instead:
Code: [Select]

void MyEngine::Init(int height, int width)
{
    App.Create(sf::VideoMode(height, width, 32), "MyEngine");
    App.SetActive();
    App.SetFramerateLimit(60);
    m_running = true;
}

Pages: [1] 2 3