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

Author Topic: Creating a classic game  (Read 5303 times)

0 Members and 1 Guest are viewing this topic.

Jack Lam

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Creating a classic game
« on: February 26, 2022, 02:39:22 pm »
        public void Run()
        {
            load();
            // game loop
            Clock clock = new Clock();

            while(window.IsOpen)
            {
                window.DispatchEvents();
                totalTimeElapsed = clock.ElapsedTime.AsSeconds();
                deltaTime = totalTimeElapsed - prevTimeElapsed;
                prevTimeElapsed = totalTimeElapsed;

                frameTimeElapsed += deltaTime;

                if (frameTimeElapsed >= UPDATE_TIME)
                {
                    update();
                    this.window.Clear(this.backgroundColor);
                    draw();
                    this.window.Display();
                }
            }
        }

Hi, there. I just started making a link-up game with SFML.Net and was surprised by how great this tiny library is. By developing the game, I am also learning the structure of a game engine. Here i am seeking advices for the development of a game engine (especially lighting system), anyone there could share his experiences?

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Creating a classic game
« Reply #1 on: March 02, 2022, 12:41:09 am »
Glad you're enjoy working with SFML.

Might want to be a bit more specific on what you need help with.
Personally, I highly recommend to build a game and not an engine on its own. It's very easy to over engineer things or build things you don't even need. By focusing on the game itself, you're solving actual problems you're running into, instead of guessing what might be useful and having those things fail when trying to use them.

For lighting there are quite a few articles and implementations out there, I suggest to search a bit.
Here's one library in C++, which you potentially could port to .NET: https://github.com/MiguelMJ/Candle
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

pizzadox9999

  • Newbie
  • *
  • Posts: 4
  • SORRYZ
    • View Profile
    • Email
Re: Creating a classic game
« Reply #2 on: June 27, 2022, 03:23:10 pm »
Hey,

I was wondering if you did the .NET port? Because I would like to ask if I could use it.

Best regards pizzadox
https://github.com/pizzadox9999?tab=repositories
contains java ports of Hapax's c++ libs

Jallen

  • Newbie
  • *
  • Posts: 40
    • View Profile
Re: Creating a classic game
« Reply #3 on: August 26, 2022, 08:58:27 pm »
Hey,

I was wondering if you did the .NET port? Because I would like to ask if I could use it.

Best regards pizzadox

For the benefit of anyone else stumbling across this thread, the SFML .Net bindings are available on Nuget on the Zlib license (at the time of me writing this post), which is very permissive. By reading the license you can see whether you can use it without asking.
https://www.nuget.org/packages/SFML.Net/