✅ im trying to make a game in windows forms
im trying to make a game in windows forms, as of right now all I need to know is two things:
1. how to have a constant frame rate
(I dont it to wait a set amount of time each frame without taking into account how long each frame takes to load bc that'll make it laggy, what im doing is a sort of remake/improvement of a game I made in another programming language where it didn't take that into account and it lagged to hell, also bc my code was VERY unoptimized but still)
2. how to receive button input from the player (like check if they pressed left or whatever)
I think I'll be able to handle everything else, I just tried to find those two online and it wasn't easy :/
thanks in advance! :blobthumbsup:
16 Replies
what I'm about to suggest is not a solution to getting a constant framerate but a solution to get a reliable "game speed", as in having in-game time pass independently from the framerate
look up delta time
delta time is the time between the rendering of each frame
you can use that time as a multiplier for ingame events that depend on time, like waiting, moving, etc
WinForms wasn't designed to be a host for games.
It is a UI framework, not a game framework.
It is also legacy and shouldn't be used if you want performance and/or good looking UI.
shit then what should I be using
If you want a game framework .. MonoGame.
I think I chose windows forms bc I found a video for graphics in c# and it said that lmao
It is still actively developed (and is getting fixes / new stuff quicker than wpf), but yeah, not a tool for high frame rate games
yeah
how do I start create project in monogame?
https://docs.monogame.net/articles/getting_started/index.html
Monogame is a game framework, not a game engine.
You do everything by code.
If you want a game engine take a look at Unity, or Godot. Both of which has scene editors (and more).
Unity however isn't "true" C#. If you want to learn C# (and game dev) then monogame definitely is the best choice; if you just want to make a quick game then a game engine might be the fastest.
yeah thats what I want
i tried using unity and learning all the ui I had to figure out to do shit I feel like I could do with the language was boring af
Great!
thanks yall :)
Anytime.
$close
If you have no further questions, please use /close to mark the forum thread as answered
$winforms
LMAO