Sunday, October 23, 2022
HomeGame Developmentc# - Enter Supervisor much like Unity's in C++

c# – Enter Supervisor much like Unity’s in C++


Engaged on making my very own little “engine” utilizing SFML and C++. One of many issues I am engaged on proper now’s the enter supervisor. I like doing enter for gamers, and so forth in a particular approach ever since I began utilizing Unity and that’s like this:

void Replace(){
    Vector2 moveVector=new Vector2(Enter.GetAxis("Horizontal"), Enter.GetAxis("Vertical"))
    //Now participant could be moved utilizing moveVector
}

which I have been lacking whereas engaged on this challenge. Many of the examples for enter I see for something exterior of Unity normally makes use of 4 or extra if statements for every course which I discover not very versatile. What I need extra complicated behaviors, equivalent to with the ability to take management away from the participant? With the vector2 technique seen above I can simply ‘hijack’ the vector for my very own functions.

I additionally can not seem to discover any libraries that can help you deal with enter much like the best way I need to in C++.

Does anybody know of any enter managers that permit me to deal with enter in such a approach?

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -
Google search engine

Most Popular

Recent Comments