Replies: 4 comments 10 replies
-
This is cool! I always wonder why more indie games aren’t made with web tech; like almost all card games could be DOM based with a little bit of work. Lemme know if you have any feedback or would like any help with anything! |
Beta Was this translation helpful? Give feedback.
-
Thank you very much @monodop for sharing your code. I think it's quite important that the Crank community shares as much real-world code (or at least code patterns) as possible to evolve and evaluate useful cranky design patterns. Real-world examples are way better for that than just simple demos. Please allow me to be a bit annoying now. Actually it's about a special bug pattern that I've seen in a lot of non-trivial Crank components. I say "annoying" because I've already mentioned that problem at least a half-dozen times (in other issues/discussions) and frankly each time I was under the impression that everybody just thought "What the hell is that guy talking about?!?" or at least preferred to ignore that issue completely, but actually it's pretty obvious (I guess that will actually not be a problem in your app but nevertheless it's a bug): The component The most interesting case for a fixed version of the |
Beta Was this translation helpful? Give feedback.
-
I think we agree, that this
Frankly, I really have no clue at all. The only solution that I have, will look tooooo React-like and this pattern has already been discussed and it has been decided that this should NOT be used in Crank. Just for your information, what I've meant looks like follows, but like said, this is NOT an option in Crank (be aware that this // This is just for information - DON'T USE THAT PATTERN!!!
function* Inventory(props) {
...
// THE FOLLOWING SHOULD NOT BE DONE IN CRANK!!!!
const loader = usePromise(this,
() => loadInventoryData(props.name),
() => [props.name])
...
for (props of this) {
if (loader.isPending()) {
yield ...
} else if (loader.isRejected()) {
...
... loader.getError() ...
...
yield ...
} else { // => isResolved
...
... loader.getResult() ...
...
yield ...
}
}
} |
Beta Was this translation helpful? Give feedback.
-
The problem is still that Actually, I was happy that Dan (I think it's not very polite to write people's full name on the internet - sure you know who I mean => he's a Top-3 React expert) wrote the following a couple of days ago on Twitter (so it seems that I am not the only person who sees a challenge here): Oh, btw: I've written somewhere above "Frankly, I really have no clue at all" (about how to implement that). I guess I could find a way how to implement that (by using a normal generator function), but I do not now how to implement it in a way that is not a complete PITA (without using this above mentioned uncranky |
Beta Was this translation helpful? Give feedback.
-
Hey, been a while since I've posted on here. I made a little demo where I built a game in .net core, and used the Chromium Embedded Framework (CEF) to host a web app inside for all of the user interface elements (which are of course written in Crank). The benefit of doing this is that you can build your game in whatever language or engine you want (including unity or unreal - but this demo isn't made in any particular game engine), while still being able to take advantage of the millions of hours of development that went into building modern web technologies and developer tooling. Now I don't have to deal with stupid, limited UI frameworks 😉
For various reasons, I can't post the entire source code here, but I did want to post a demo video here: https://www.youtube.com/watch?v=R2NmEFjEyhQ
Thank you to @brainkim and everyone else who has contributed to Crank. This has been a fun project so far and crank has made the process of prototyping this super easy!
Beta Was this translation helpful? Give feedback.
All reactions