Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: First game  (Read 1395 times)

0 Members and 1 Guest are viewing this topic.

peter_zof

  • Newbie
  • *
  • Posts: 2
    • View Profile
First game
« on: March 25, 2013, 08:20:04 am »
Hey!

I want to write my first game in SFML and i need some advice. I have a solid bases in C++ language, but i never uses graphic libraries :)

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
AW: First game
« Reply #1 on: March 25, 2013, 09:26:46 am »
Some advice with what? ;D
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

peter_zof

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: First game
« Reply #2 on: March 25, 2013, 10:00:48 am »
I read some SFML tutorials, but I don't know how to load map for example. I have very simple program:

CODE:

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow oknoAplikacji( sf::VideoMode( 800, 600, 32 ), "Kurs SFML - http://cpp0x.pl" );
    while( oknoAplikacji.isOpen() )
    {
        sf::Event zdarzenie;
        while( oknoAplikacji.pollEvent( zdarzenie ) )
        {
            if( zdarzenie.type == sf::Event::Closed )
                 oknoAplikacji.close();
           
            if( zdarzenie.type == sf::Event::KeyPressed && zdarzenie.key.code == sf::Keyboard::Escape )
                 oknoAplikacji.close();
           
            if( zdarzenie.type == sf::Event::MouseButtonPressed && zdarzenie.mouseButton.button == sf::Mouse::Middle )
                 oknoAplikacji.close();
           
        }
        oknoAplikacji.clear( sf::Color( 255, 0, 0 ) );
        oknoAplikacji.display();
    }
    return 0;
}


However I don't know what to do next?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11032
    • View Profile
    • development blog
    • Email
Re: First game
« Reply #3 on: March 25, 2013, 10:11:10 am »
Please use the code=cpp tag to post code!

I then suggest to use English variable names, so someone not speaking your language will immediately understand your code, it's also kind of what everyone does. ;)

We won't be programming your game, so I don't know how we can help. You first need to figure out, what you want to do exactly. "How to load a map?" just doesn't say anything. Maps can be 3D, 2D, tilebased, isometric, etc. etc. - there are endless possibilities!

You need to first comeup with what you want your game to be and then you go and look at the documentation of SFML, use google and your brain and think about how you could implement it. If you have basic knowledge in C++, then you're quite comfortable with OOP, right? So you can easily come up with a nice OOP way of handling objects etc etc. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Tank

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1486
    • View Profile
    • Blog
    • Email
Re: First game
« Reply #4 on: March 25, 2013, 01:55:09 pm »

 

anything