Re: Shooter with C#

The problem I have with State is, that it doesn't correspond very well to certain game situations.
For example, in Eurofly, there is a VirtualWindow named Cockpit, from which you can control the plane during flight. And it has several more subwindows, like chat, flight computer, etc. which completely changes game's behaviour, but not what's currently happening.
So, if you're flying the plane, okay, your game's state is cockpit, because you're in a cockpit, not in a menu, and you're flying the plane, not browsing a map. But does this state change just by looking to the chat panel, if there are new messages? That causes a new window to appear, but you're still in the cockpit, flying the plane, just looking to one of your panels.
For me, talking about changing states here makes less sense, even if one just overlapped another, than saying, that a new game window appeared, which doesn't necessarily evoke cancelling the previousone.

But it's rather linguistic question than a coding aspect plus highly subjective, so it doesn't matter very much.
If I was coding it today, I would perhaps go with the name State, or Screen. Not because of terminology, but simply for the reason, that VirtualWindow is too long. It was originally just Window, I have implemented it in this way in few languages like Python, C++ or some basics in _javascript_, problem with C# was, that Window is also a class used by WPF, so oops. big_smile
I had to think of something other, and since screen didn't come to my mind, VirtualWindow was the choosedone.

As with the keyboard shortcuts, does WPF have a handler for this? When I was looking for it some time ago, when I was programming the first C# version of Ride, the only usable thing I've found were WPF commands, which have a support for keyboard shortcuts. But they require quite lot of code to write, I wanted just something very simple, what would allow me to connect a keyboard shortcut with certain method with one line, on one place, where I could group all of this linkings and thus change shortcuts or their targeting methods on one place whenever I wanted to or just add or remove them in matter of seconds.
So rather than messing with commands, which would be probably very useful in bigger and more complex apps, but not in my small application, I came up with my own solution to keyboard shortcuts, in form of KeyboardShorcut class.
Later, when I was coding the VirtualWindows, this class became very handy, so I just grabbed it and included.
But if WPF had its own, easy to use, solution, it would be preferrable of course.

Best regards

Rastislav

-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : omer via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : jonikster via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Ethin via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : sanslash332 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : jonikster via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bgt lover via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : Rastislav Kiss via Audiogames-reflector
  • ... AudioGames . net Forum — Developers room : nuno69 via Audiogames-reflector

Reply via email to