Roguelike coding challenge game! hero.look() is broken! See team page for fix!
We're sorry - hero.look() is broken. Here is the fix - just add this code to your bot:
hero._l=hero._l||hero.look;var c={up:{y:-1},down:{y:1},left:{x:-1},right:{x:1}};hero.look=(dir,n)=>{if(dir==null)return hero._l();var dx,dy;if(dir.length){n=n||1;dx=(c[dir].x||0)*n;dy=(c[dir].y||0)*n;}else{dx=dir;dy=n;}return hero.look().find((o)=>o.x==dx+hero.x&&o.y==dy+hero.y)||hero._l(dx,dy);};
The glorious dungeon keeper has vanished into oblivion and now the dungeon is free for your to take it over!
Use the power of JS to create your own hero and make it obey your commands! Use instructions in the example code to craft the perfect dungeon warrior!
Collect gold, find most powerful weapons and smash the enemies. Level-up from tiny zombie into powerful knight.
But beware! No one can surpass the glorious dungeon keeper!
Please, don't forget to paste fix above to your code.
Game is turn-based rogue-like, where you control your hero using ai written in JS.
Use example code or craft your own bot. Example code contains useful instructions for how to write it.
Special thanks for 0x72 for his awesome tile set - https://0x72.itch.io/dungeontileset-ii.
Fun game for coders. These types of "code your own AI" games can suck you in.
This a cool app for teaching kids (and adults) how to code. The idea (and the implementation) was very entertaining. Great job!
Good work! This is an interesting, good-looking idea that could use a pass of debugging and simplification. I'm impressed with how much you got done during such a short competition, but I think you may have been hurt by trying to have such a broad scope.
It felt great to manage to get the hero to move with my own "AI" but it was also really easy to get irretrievably lost (even crash the browser tab). I didn't very far after learning how to do the basics because of this (and a somewhat high learning curve, but that might be unavoidable with a game like this).
If you were to continue working on this, I would recommend using a simpler signature for `tick`: execute the function and take its return arguments as the input for the character on that turn (eg, { action: 'move', direction: 'up' }). That way, instead of sending individual 16ms-ish commands as if I'm writing the game engine itself, it's more like I'm programming a bot that plays the game through a controller. This would make it harder for player code to crash the entire system.
What a fun way to learn about JavaScript generators!
I definitively need some time to flex my skills here.
Do you have plans to keep it online after the hackathon?
(Maybe with a speaking domain)
I like the idea - I can see this as being a great tool for teaching kids to code :)
wlodzislav
Thanks! It's the best way to procrastinate instead of writing code ^^