

Tweet at this bot to make games using emojis for scripting - elisee
http://gdevbot.sparklinlabs.com/?1

======
elisee
I tried submitting this bot I made yesterday
([https://news.ycombinator.com/item?id=7924323](https://news.ycombinator.com/item?id=7924323))
but didn't realize it was the middle of the night in the US. Trying again in
the hopes that it will catch some more attention.

~~~
underwater
Interesting. But it's a bit hard to tell what the bot does just from this
page. Could the sample games show the Tweets that were sent to create them?

~~~
elisee
Thanks! Yes, I implemented the logging system after those two games were made
so they don't have a public log right now but I'm gonna try and build a little
game to demonstrate the whole thing. Feel free to follow
[https://twitter.com/gdevbot](https://twitter.com/gdevbot) for updates.

EDIT: I'm building a little game now, you can see it get build over here -
[http://gdevbot.sparklinlabs.com/p/starpick/edit](http://gdevbot.sparklinlabs.com/p/starpick/edit)

~~~
elisee
And precisely 60 tweets later... here's a game! Hold mouse down to move, catch
the stars, avoid the spikes.
[http://gdevbot.sparklinlabs.com/p/starpick/edit](http://gdevbot.sparklinlabs.com/p/starpick/edit)

~~~
voltagex_
Whoa. Reminds me a bit of Logo.

------
teamonkey
Fantastic stuff. Can you give some more info on how it was created, what
libraries it uses etc.?

~~~
elisee
Sure! (I made the source code public at
[https://bitbucket.org/sparklinlabs/gdevbot/src](https://bitbucket.org/sparklinlabs/gdevbot/src)
btw)

So basically it's a Node.js app built in CoffeeScript. I'm using node-twitter-
api to subscribe to the bot's twitter notifications
([https://bitbucket.org/sparklinlabs/gdevbot/src/tip/app.coffe...](https://bitbucket.org/sparklinlabs/gdevbot/src/tip/app.coffee?at=default#cl-276)).

Whenever a tweet arrives, I check various stuff (is it a retweet? are multiple
people mentioned? more than one hashtag?) to decide whether it's a command or
it should just be ignored. If all checks out, I parse the tweet's text
([https://bitbucket.org/sparklinlabs/gdevbot/src/tip/app.coffe...](https://bitbucket.org/sparklinlabs/gdevbot/src/tip/app.coffee?at=default#cl-16))
into a command and relay it to the backend for processing
([https://bitbucket.org/sparklinlabs/gdevbot/src/tip/lib/backe...](https://bitbucket.org/sparklinlabs/gdevbot/src/tip/lib/backend.coffee#cl-142)).

Images are validated & their size clamped using a node graphics-magick module.
Emoji scripts are parsed using a custom parser I cobbled together
([https://bitbucket.org/sparklinlabs/gdevbot/src/tip/public/js...](https://bitbucket.org/sparklinlabs/gdevbot/src/tip/public/js/parseScript.coffee))
and JavaScript comes out on the other end.

The tiny game engine works with actors (or game objects in Unity3D parlance,
it's very similar except 2D-only), they can have components (an image, one or
more scripts) on them and can be parented to one another.

I've been building a cooperative game-making platform called CraftStudio
([http://craftstud.io/](http://craftstud.io/)) for the past 2-3 years and
@gdevbot was just a kind of crazy "why the hell not" project inspired by all
that work that I decided to build a couple weeks ago.

------
hayksaakian
There should be a game jam with this system as the theme

