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

Pages: 1 ... 5 6 [7]
91
General / New to SFML, game design questions
« on: August 24, 2011, 11:57:06 pm »
I use a design in my game where each object has it's own draw function.
I call game.draw() which in turn calls level.draw() , ball.draw() , and panel.draw(). I don't see why this is a bad approach?

Also, how should i handle different game states like the menu etc. Have a draw function and update function for each different state?

92
SFML projects / iCEĀ³ - clone of Minecraft
« on: August 24, 2011, 10:45:46 pm »
a-m-a-z-i-n-g

Damn man, nice work!
How did you draw the graphics? OpenGL in an SFML context?

93
SFML projects / X-Break
« on: August 24, 2011, 10:32:42 pm »
X-Break

Introduction:
Hello everybody, my name is Xander and I'm pretty new to these forums. Two days ago I decided it was time to start with my first serious project, after playing around with SFML for a bit over a week.
 And thus, X-Break was made! It's an old-school breakout clone, but I plan on implementing some more modern features once I get the basics working properly!

Pictures:
I have now menu at the moment, but the core of the game (collision, moving, levels etc) is working. Please keep in mind that the panel and the brick sprites are placeholders.
The ball, background and side stuff seems good imo. (I will structure the side panel more, however)
Here some screenshots:





Future Goals:
Ordered from most important to least:
[ ] Special types of bricks
[ ] Bonuses (which sometimes drop when bricks are destroyed), some ideas are "Time Warp", which freezes the ball(s) for a certain amount of time, and ofcourse the classics like shortening the panel or enlarging it)
  • A Menu

[ ] A level editor
[ ] A campaign
[ ] Procedural level generation
[ ] Multiple "areas" eg, in the desert, forest etc with each it's own special attributes which slightly alter the gameplay.

Do you have any ideas? Feel free to post them!

Why am I doing this?
Main reason: to keep myself motivated and to receive some feedback.
Another reason being that IMO too many of these threads are on this forum! :D

PS: I will post more pics and upload the binaries and possibly source soon, but it's late at night and I'm tired!

94
Window / Failed to activate the window's context.
« on: August 24, 2011, 02:17:16 pm »
Wow, thanks for the quick reply Laurent!
I thought, that if I'd call prepare_function directly, it wouldn't keep on drawing?
For example, my paddle won't move anymore, and the numbers will stay on the screen and painted over (ugly)?

EDIT:
If I call it directly it crashes :(

95
Window / Failed to activate the window's context.
« on: August 24, 2011, 01:26:40 pm »
I searched around already and it seems it always has got something to do with OpenGL. Well I'm not using openGL. It's the first time I try running different threads ^.^

Here's my code:

Code: [Select]
void Game::tick()
{
    ball.tick();

    //get mouse coord
    float x = Window.GetInput().GetMouseX();
    panel.tick(x);
    updateText();

    if(killedBricks == levels[currentLvl].amountOfBricks) //level over
    {
        currentLvl++;
        ball.reset();
        return;
    }

    if(prepare)
    {
        prepare = false;
        ball.pause();
        sf::Thread thread(&Game::prepare_function, &*this);
        thread.Launch();
    }
}

void Game::prepare_function()
{
    sf::Clock clock;
    int i = 0;
    sf::Font myfont;
    myfont.LoadFromFile("GOUDYSTO.TTF");
    sf::Text text("", myfont, 30);
    text.SetPosition(300, 300);
    while(i < 3)
    {
        int i = clock.GetElapsedTime();
        if(i < 1)
        text.SetString("3");
        else if (i < 2)
        text.SetString("2");
        else
        text.SetString("1");
        Window.Draw(text);
    }
    ball.start();
}


The purpose is (it's a breakout game btw) that if the ball goes out of screen (thus -1 live) we wait first 3 seconds before releasing the next ball.
I was also thinking of having a separate thread for audio and one for drawing.

help?

96
Graphics / Qt + SFML: drawing only half sprites :S
« on: June 27, 2011, 08:44:50 pm »
I've finally been able to set up Qt with SFML and I've already run into another problem :D
I have a QDockWidget which contains a TileCanvas. ( a derived class off QSFMLCanvas, from the tutorial) I draw my sprites on it, but  once I try to draw past ~100 pixels, it stops drawing. It even draws half sprites like that :/

Here's a picture:


I don't know what the problem is, help! :(

Pages: 1 ... 5 6 [7]