As I started to build my game with GateEngine and it requires connection over web socket
I've updated my Web socket lib to support WASM
To come is my API lib adding similar support but for CRUD requests
will post here how it goes :)
Feel free to give it a go and test it out. Also Any feedback is appreciated. So far usage looks exactly the same to other platforms besides one minor difference which is init:
#if os(WASI)
let request = "ws://127.0.0.1:8080/game?name=WASI&team=B"
#else
let request = URLRequest(url: URL(string: "ws://127.0.0.1:8080/game?name=Szymon&team=A")!)
#endif
where on other platforms where URLRequest is supported you can work with headers and stuff. Under WASM It is not possible, due to that limitation of using String as URL
Love this! I've got it on my TODO to start working on a menu "system" also. Would love to glance at your code, if you've got it in a public repo anywhere.
Personally, I think this is the kind of thing that should go into the GateEngine repo itself. I was planning to do a first pass in some helper repository, and then create an issue that suggests moving it.
I'm essentially imagining two classes, a MenuSystem parent class, much like you have here, as well as a MenuButton class. There would be functions for adding buttons to the system with focus intent, so the input handling can all be abstracted away. (Ideally you wouldn't need to think about input or rendering when implementing a Menu or its buttons, just focus paths and absolute (or relative?) positions.)