5 ms·
I really like this guy's writing and am grateful that he shared some of the coding challenges. I'd really like to be able to program games like this, and while
by TurkishPoptart 7y ago
I really like this guy's writing and am grateful that he shared some of the coding challenges. I'd really like to be able to program games like this, and while I'm not a programmer, I'd like to learn how. In TFA he shares some of the code to check the coffee "state":
>'LOOK AT COFFEE MAKER': () => {
if( State.scene.state.coffeedrunk ) {
return "The coffee maker has done its job and mercifully drained the
last life out of the old and savaged grounds."
} else if( State.scene.state.brewed ) {
return "The coffee maker has a fresh pot of what is likely coffee in it."
} else if( State.scene.state.brewing ) {
return "The coffee maker is brewing."
} else if( State.scene.state.waterinmaker ) {
return "The coffee maker has fresh water in it, and is ready to brew
a terrible cup of coffee."
} else {
return "Makes coffee. Whodathunk? There's no water in it, and you don't
have any fresh coffee, but the grounds already in there have
only been used twice and can't be THAT moldy."
}
}
This is JavaScript right? Is that how these sorts of games are coded? Would learning this be the best way to go about creating games? Thanks.
- whatshisface 7y agoIt looks like JavaScript to me. Yes, these games are usually coded in scripting languages like JS or Python, even back in the day they were programmed in custom scripting languages running on the engines of yore. Finally, yes, these kinds of games are a great way to learn programming because they map very well on to basic control flow constructs (if, else, while) and don't usually require additional computer science knowledge.
- drankula3 7y agoFor python, check out pygame. It's outdated and only works with 2.7, but I think it can be installed with apt on Ubuntu and will teach the basics like rendering loops, frames, etc.
- throwaway377373 7y agoIt works with Python 3.7 now, and has for sometime. `sudo pip install pygame`
- manifestsilence 7y agoPygame is still alive and great. It even has built-in support for game controllers, and nice stuff for managing sound effects.
- brians 7y agoI’d start without the animations, in something like Inform 7: http://inform7.com/ http://inform7.com/ It’s easy to learn small things, reasonable to scale to harder things, and the award winning games regularly publish their sources—so you can copy and tweak and learn.
- aasasd 7y agoI lately got a buzz to play some detective adventures, which predictably had me combing through the lists of adventures on several sites. As a result, I now have a lament that there doesn't seem to be an engine for creating graphical adventures as easily as text ones: with lots of ready-made images that could be put in the proper order for the game. Not even with much interactivity, since something like HTML with hyperlink trees of choices would likely be more humane than point-and-click pixel hunting. Though, maybe Adventure Game Studio and free images do the trick, dunno. Specifically, I myself would play games that are set in the same city if the city was big and detailed enough. Just let the games be something more than the hyper-casual churn of ‘question the witnesses, look for evidence, name the perpetrator.’
- jacobr1 7y agoThe original games uses a custom scripting engine that manages this called SCUMM. For a good description see: https://www.monades.dev/scumm-internals-syntax/ https://www.monades.dev/scumm-internals-syntax/
- egypturnash 7y agoSCUMM was used by Lucasfilm's adventures; its name is an abbreviation of Scripting Utility For Maniac Mansion. Sierra's graphic adventure games used their own toolkit called AGI, which stood for Adventure Game Interpreter. http://www.agidev.com http://www.agidev.com
- acomjean 7y agoRon Gilbert who wrote SCUMM has a blog. It’s kinda fun https://grumpygamer.com/about https://grumpygamer.com/about He also wrote a new adventure game and blogged about its development https://blog.thimbleweedpark.com/ https://blog.thimbleweedpark.com/
- visitect 7y agoThimbleweed Park was such as joy to play. I originally played it on my desktop, but ended up buying it again later for the Swtich. I was delighted to see my daughter start playing it one day, and she was really enjoying the unique and now-rare gameplay. She liked it so much, she now has a ThimbleCon '87 poster on her wall. If you're around here, Ron, kudos for an excellent artistic contribution to humanity.
- throwaway66920 7y agoWhen you think about game design you have two big buckets. Writing code to make mechanics work, and writing code to make new content. This kind of game is almost entirely the latter because it’s not much more than handling one off edge cases and is very simple. I would recommend using https://love2d.org/ https://love2d.org/ to get started. This is a simple language built around a 2D game engine with (I think) many examples to follow
- nebulous1 7y agoIf you want to create a game you could go with GameMaker or Construct 2 or Adventure Game Studio (if you want an adventure game like SQ1 that he's describing). These are applications that provide you with an interface you can interact with, along with an associated programming language in order to make things happen. So you can draw levels and place objects with your mouse, and then make them move with a script. GameMaker has a non-programming method but I don't know how capable it really is. I wouldn't worry too much about what language you learn, at your stage it's more about the general knowledge of how to get things moving. Transitioning to another language at a later point won't be difficult.
- afrodc_ 7y agoConstruct is great for simple games like this and is pretty intuitive.
- johnmaguire2013 7y agoNuclear Throne is the best example of a solid game made in Game Maker that comes to my mind. Looks like Spelunky, Undertale, and Hyper Light Drifter were as well.
- akx 7y agoAlso Baba Is You.
- pugworthy 7y agoNot sure why this isn't handled in some kind of data-driven way, rather than a bunch of one off code. The truth is, the author is coding an irrational and illogical system, and what this is basically is a big old set of special cases. But then keep in mind the whole piece is satire.
- erikpukinskis 7y agoI can’t speak for the author, but one reason not to use data for logic is that you’ll end up building a (difficult to use, buggy) programming language in your schema. And if you’re going to do that, why not just use a programming language, which is a lovely way to encode logic? I would turn the question around on you: why would you put this in data? If you have too much boilerplate, just refactor your code.