4 ms·
Anybody think of another way to do the robot levels without adding any state? https://gist.github.com/db41e069df7bae142248 https://gist.github.com/db41e069df7b
by resist_futility 13y ago
Anybody think of another way to do the robot levels without adding any state?
https://gist.github.com/db41e069df7bae142248 https://gist.github.com/db41e069df7bae142248
- opnitro 13y agoYeah, I just built a wall that it got stuck behind, then I could run to the door before it got me. Don't have the code sorry.
- columbo 13y agoI _was_ going to build a pathfinder since it's a well documented process, but it was more work than just making the player a joystick http://qiao.github.io/PathFinding.js/visual/ http://qiao.github.io/PathFinding.js/visual/ You'd just need to recalc the pathfinder each time.
- xmonkee 13y agohttps://gist.github.com/xmonkee/10099892 https://gist.github.com/xmonkee/10099892 The robot follows my player, unless it's green, in which case it goes 'down' (cause it wont pick up the key under remote control for some reason). I'm saving state in the color of the player.
- galvan 13y agohttps://gist.github.com/anonymous/486caea6cc41f13dca76 https://gist.github.com/anonymous/486caea6cc41f13dca76 The robot goes down unless its x-coordinate is between 20 and 33, in which case it goes up. Kinda cheesy, but it works...
- joshka 13y agoFollow the player left right, and move mirrored on a line. Works pretty much unmodified for 12 and 13. https://gist.github.com/anonymous/f59ea23c9a421d93c2c1 https://gist.github.com/anonymous/f59ea23c9a421d93c2c1
- SheeEttin 13y agohttps://gist.github.com/anonymous/12b15e3de9340655ed78 https://gist.github.com/anonymous/12b15e3de9340655ed78 Variable to control the direction the robot moves, changed with the function phone.
- christiangenco 13y agoThis was mine: var r = Math.random(); me.move( r < 0.4 ? 'right' : r<0.6 ? 'up' : r < 0.8 ? 'down' : 'left' ); Works eventually :) For level 13 I just used: me.move(Math.random() > 0.5 ? 'right' : 'down'); And regenerated the map until I got to one that could be solved by moving only right and down.
- benvan 12y agoyeah. I made it follow a cosine path: http://benvan.co.uk/cosine.gif http://benvan.co.uk/cosine.gif