https://github.com/jbrosdevelopment/sfml_game_loop
A simple game loop class system that adds Start and Update functions to your SFML.Net project
https://github.com/jbrosdevelopment/sfml_game_loop
Last synced: 11 days ago
JSON representation
A simple game loop class system that adds Start and Update functions to your SFML.Net project
- Host: GitHub
- URL: https://github.com/jbrosdevelopment/sfml_game_loop
- Owner: JBrosDevelopment
- Created: 2024-09-12T00:31:40.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-09-23T01:03:00.000Z (over 1 year ago)
- Last Synced: 2025-10-24T22:41:50.123Z (3 months ago)
- Language: C#
- Homepage:
- Size: 1.04 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# SFML Game Loop
Install with Nuget:
> `dotnet add package SFML_Game_Loop`
A simple game loop class system that adds Start and Update functions to your SFML.Net project
```cs
using SFML.Graphics;
using SFML.Window;
using SFML_Game_Loop;
public static class Program
{
public static void Main(string[] args)
{
MainMenu mainMenu = new();
mainMenu.BeginRoutine();
}
}
class MainMenu : WindowRoutine
{
public MainMenu() :
base(new VideoMode(600, 400), "Main Menu", Styles.Default, new Color(255, 255, 255))
{
}
public override void Start()
{
button = new Button(
position: new Vector2f(Center.X - 250, Center.Y - 75),
size: new Vector2f(500, 180),
color: new Color(125, 125, 125, 125),
fontColor: new Color(225, 225, 225),
text: "PLAY!",
charSize: 48);
button.Clicked += ButtonClicked;
Elements.Add(button);
}
public override void Update(double delta)
{
}
}
```