39 ms·
Show HN: Untrusted, a JavaScript adventure game you play by modifying its source
- deleted 13y ago[deleted]
- mandlar 13y agoI'm not sure what happened with level 4 multiplicity, but I placed a 2nd exit inside the box. Then when I go through it says it completed the level but I'm still on the multiplicity level. Reseting does not fix. https://gist.github.com/anonymous/0dafb64fad2ddd6fd451 https://gist.github.com/anonymous/0dafb64fad2ddd6fd451
- valgaze 13y agoThink it's a bug: https://www.youtube.com/watch?v=Izs5wFFAaaU https://www.youtube.com/watch?v=Izs5wFFAaaU
- pokpokpok 13y agothis happened to me, but i went through the exit again and this time it worked
- alnis 13y agoA few people have reported a similar bug. I don't think that it's level specific but has something to do with the next level not leading correctly upon completing a level. We're still not sure why it happens or when (it seems to only affect a few people), but we'll try to figure it out. There aren't any errors you can see in the JavaScript console, are there?
- mason55 13y agoIt happened twice to me, once on 4 once on 8 I think. Both times it happened when I went through the exit then went back to it.
- __oz 13y agosame here, putting another exit on the canvas breaks things in a weird way
- fakeanon 13y agovalgaze: your comment is not visible unless a user has showdead turned on.
- bcherry 13y agoYou had me at "The continuing adventures of Dr. Eval"
- ezarowny 13y agoI really like that it has WASD/Arrow/Vim controls. Props.
- jayferd 13y agoContent note: plays sound. Did the quick ^W at work :|
- th0br0 13y agoYou should reinit the map though, otherwise doing this on level 2 causes funny bugs (and makes the game rather easy ;) maze.create = function() {}; var tmp = map.placeObject; map.placeObject = function(x, y, t) { if(t == 'exit') tmp(x,y,t); };
- untitaker_ 13y agolevel 2 can be solved by using the two "unlocked" lines to comment out the whole maze.create call, too.
- maaaats 13y agoThat's kinda the point, though. Read the comments for that file. ;)
- mt3ck 13y agothanks for the help ;)
- randunel 13y agoyou don't need 2 lines, you only need the one below to overwrite the map function, and leave an open dot :D map.placeObject(7,4,'exit');var a = {map: {placeObject:function(){}}};a.
- zenojevski 13y agoRelated: things like these do not work, because of implementation. if (false) // <- inserted by me for (var ...) { // <- existing code ...code... } Too bad, because extra `for`s could be fun...
- alnis 13y agoIf you reload the game, the map should now re-init on every level. PS. I'm really enjoying all the creative solutions you guys are coming up with!
- devilshaircut 13y agoI broke level 4. Is there an obvious way that I am missing to reset at the level you're on when the reset functionality provided under the text editor is insufficient?
- alnis 13y agoThe Reset button should completely reset editor state for the level. What happened?
- devilshaircut 13y agoBtw, I should have said first that I love this game idea and myself and my coworkers have been playing it a bit for the last 20 minutes or so. I broke my game by reassigning the getWidth method to return an invalid value: map.getWidth = function() { return 1; } The approach worked with a valid value: ( map.getWidth = function() { return 6; } ) and I beat the level, but I had to replay the previous 3 levels. Some suggestions (Again, we loved the game!) - Provide some interface to conveniently index all the solution Gists. - Provide some way to quickly skip to last level played. Other thoughts: - Enjoyed the look, feel, and user interaction. - The music was great. - I will keep playing this game. :)
- alnis 13y agoOh, quick note - you can skip to the last level played in the Menu (Ctrl-0). We should probably make that more obvious.
- devilshaircut 13y agoAh - I see what menu does now. I love this game and have uncovered a few broken game states. This mainly happens when I reassign one of the API methods. Are you interested in user-submitted issues? Let me know; I could email them to you or log them on your GH; whatever is convenient.
- 13y ago
- Slix 13y agoThis music is awesome. What genre is it?
- alnis 13y agoIt's from a combination of electronic sub-genres by some independent artists. You can see the full list of tracks here: https://github.com/AlexNisnevich/untrusted#soundtrack https://github.com/AlexNisnevich/untrusted#soundtrack
- jpolitz 13y agoThis worked for the whole first chapter for me (and has some obvious further applications): startLevel["constructor"]("m", "console.log(m);" + "var old = m.placeObject;\n" + "m.placeObject = function(x,y,t) { \n" + "console.log(t);\n" + "if (t === 'exit' || t === 'computer') {\n" + "console.log('adding' + t);\n" + "return old['ca' + 'll'](m, x,y,t) }};")(map); EDIT: I wonder if you could wrap the user's code in, e.g. https://code.google.com/p/es-lab/wiki/SecureEcmaScript https://code.google.com/p/es-lab/wiki/SecureEcmaScript, and use this to gamify finding bugs in that sandbox :-)
- jacktoole1 13y agonice! similarly, var oldPlaceObject = map.placeObject; var newPlaceObject = function(x, y, type) { if (type !== 'block') { map.placeObject = oldPlaceObject; map.placeObject(x, y, type); map.placeObject = newPlaceObject; } }; map.placeObject = newPlaceObject; was my solution to multiple levels ;).
- kybernetikos 13y agoI also had to overwrite the map.verifyXitems (or whatever it was) to return true regardless.
- lawl 13y agoThis is fun. But I have one wish. Overwrite console.log() so it logs onto the website and I don't need to open firebug :) Edit: I think I solved lvl two to four all the same way. Not sure if that's intended. But I also don't want to spoil it for others. Edit 2: This worked again at lvl 6, so I'll assume that's a bug. Click this pastebin for spoilers: http://pastebin.com/yfhDhE7P http://pastebin.com/yfhDhE7P
- alnis 13y agoGood catch! We haven't been checking yet for tampering with functions, but we probably should. Don't think of it as a bug so much as a cheatcode you discovered :-)
- gizmo686 13y agoAww, I thought that was to easy. That trick works for basically any level. Also, is there a good way to completly prevent tampering with functions, or is this just going to be an arms race?
- lawl 13y agoDon't use the functions from the map object, but keep a separate function reference for validation? I mean if you want to cheat you always can. But that's not the point. Right now you can cheat using official apis. Just use map._blah() for internal use By the way: Same trick works for keys.
- demallien 13y agoObject.defineProperty with 'writable' = false?
- yuchi 13y agoObject.freeze?
- TeMPOraL 13y ago> Also, is there a good way to completly prevent tampering with functions, or is this just going to be an arms race? Let's hope for an arms race - it will be far more fun and educating at the same time.
- nanidin 13y ago> "If you can read this, you are cheating! D:" Loaded the site, popped open the Chrome Dev Tools, and was thoroughly disappointed.
- tehwebguy 13y agoWhy were you disappointed?
- nanidin 13y agoWell, the title says you play the game by modifying the game's source. Turns out you don't modify the game's source, you modify specific snippets of code that are provided on the page. Last weekend I hacked around in the source of various online games, I anticipated this to be a similar experience but was disappointed to find that we weren't supposed to actually change the game's source.
- SheeEttin 13y agoWell you can play it that way too, if you want. Try overriding some of the internal functions using creative methods. :)
- lectrick 13y agoI tried to move the exit inside the walls. I was unable to edit any of the code. I thought that was the point?
- maaaats 13y agoCtrl+5 to reload the level after you changed it. Did you do that? On one of the levels I created a new exit inside, and it worked.
- pritambaral 13y agoBorks at level 7, upon touching phone with undebuggable message on canvas: d up the function p 1, found:oad the level Wone! number of exits ...
- alnis 13y agoBizarre! I haven't been able to reproduce it. Can you share your code for that level (if it's been modified at all)?
- pritambaral 13y agoUnmodified. Chrome 33 on Linux
- tinacgh 13y agoAlnis, love the game! But I also ran into unexpected behavior after clearing level 7 (change your color). It kept reloading the same level, but opening up new levels in Level select. Even so, clicking on higher levels keeps reloading the same colors.js screen. Another weird thing I noticed was that next to the computer and telephone in the inventory, two letters "k" appeared. I'm using Firefox 28 on Windows 7. Here's the solution I used for colors.js https://gist.github.com/anonymous/ab5cd3b393c290fbf8c1 https://gist.github.com/anonymous/ab5cd3b393c290fbf8c1
- Aardwolf 13y agoI'm not sure what the real intention of the level "Multiplicity" was, but just placing an exit anywhere you want works just as well!
- alnis 13y agoMultiplying the exits is useful ;-)
- Aardwolf 13y agoHeh but then what was the real intention of the earlier maze level? I already multiplied the exit there :) Anyway, really nice work with the game!
- alnis 13y agoThanks! The intended solution to the maze level was commenting everything out. But of course, all of these have multiple solutions :-)
- tpae 13y agostupid drones, me.selfDestruct (tableflip)
- henryw 13y agoI made a wall to circle around the drone. Pretty fun.
- Siliconic 13y agoI found it easier to make myself invincible. map.getPlayer().killedBy = function() {}; Drone just follows you around like harmless puppy. https://gist.github.com/anonymous/dfb6822e683ea7418ea8 https://gist.github.com/anonymous/dfb6822e683ea7418ea8
- randunel 13y agohahah i love this game :D
- Vagasaurus 13y agoWorks for the water as well. :]
- BostX 13y agoNeo: What are you trying to tell me? That I can dodge bullets? Morpheus: No, Neo. I'm trying to tell you that when you're ready, you won't have to. :)
- Rampoina 13y agoI did the exact same thing.
- RobotCaleb 13y agoMake your own drones. https://gist.github.com/anonymous/c18b7b1e7ab1d672da55 https://gist.github.com/anonymous/c18b7b1e7ab1d672da55
- 13y ago
- shangxiao 13y agoI wasn't sure how to show all the mines on the minesweeper map, so I just place them all at the top... was this supposed to be the point? :) Anyhoo, nice game, it doesn't matter how you solve it, as it still proves that eval is evil ;)
- lawl 13y agoCtrl+1 for API docs. There's an API to change the color of a tile :)
- zenbowman 13y agoPretty cool game bud, I actually think this is a superior environment for learning to program than many of the richer 3-d interfaces I've seen.
- valgaze 13y agoDon't open your console: http://i.imgur.com/kyi79ux.png http://i.imgur.com/kyi79ux.png
- javajosh 13y agoVery cool! I'm stuck on level 7 because it seems that the script isn't editable anywhere. Related note, the color scheme for highlighting editable lines might want to change, because "black on dark maroone" doesn't exactly jump out. Love that you're auto-gisting solutions. That was clever - I presume you are browsing through searching for the common description tag? I also like the API popup, although I didn't see it until I got stuck on the (uneditable) level 7. I verified this because $('.editableLines') == [] in console! Perhaps this is a very fancy meta-game that you can only win with a pull request? :)
- alnis 13y agoThanks! Does your level 7 not look like http://i.imgur.com/AFTxPWC.png http://i.imgur.com/AFTxPWC.png ?
- adeaver 13y agoThis took me a bit as well but there is a small bit that is editable, but I agree that it isn't clearly defined, especially when it's only a few characters and not an entire line. Hint: Phone functions
- jblz 13y agoVery fun. I found a bug that lets me skip levels 8-11 by using this code in the phone callback on level 7: if ( ! ( player.cc && player.cc.length ) ) { player.cc = ['#f00', '#ff0', '#0f0']; } player.setColor(player.cc.shift()); It says it's loading the next level, but the code and gamefield remain stuck on level 7 until you push it to level 12.
- tinacgh 13y agoIs there an easy way to transfer progress between computers? (other than saving your solution Gists?)
- muxxa 13y agoUsing CTRL+Q for the phone is dangerous on a mac, as it's easily confused with APPLE+Q which closes the browser window, losing your progress. --- Edit: it saves the game state in localstorage; kudos!
- wging 13y agoAt the top left, in 'Chrome', there's a useful 'Warn before Quitting' option.
- gabemart 13y agoCan anyone give me a hint for level 12?
- XaspR8d 13y agoYou're defining a robot's properties, so you might want to define its properties. That'll open the door to higher-level navigation logic. (Being obtuse is difficult...)
- rooodini 13y agoI made the robot follow a cosine curve. Cute but ridiculous solution.
- pilom 13y agowow that level took me forever. Ended up using things along the lines of if( me.getX() < 15) {move down then right} elst if me.getX()>15 and < 30 {move up then right} etc.
- lockes5hadow 13y agoYou could always implement a-star, a searching algorithm.
- frzen 13y agoYou could create your own robot control system based on pressure plates as well
- cheepin 13y agoI personally wired the bot to track and follow my movements. Then I just walked the bot through the maze.
- icemelt8 13y agoWhat if the triangular walls were straight?
- bluesnowmonkey 13y agoI encoded a route. moves = [['down', 5], ['right', 20], ['up', 1] /* and so on */]
- vjeux 13y agomap.validateExactlyXManyObjects = function() {}; lets you put an exit tile next to your character on every level
- aaronem 13y agoThis is fun! But I've run into a problem. Advancement past level 14 seems to be bugged; upon completion, the keys in my inventory were replaced with a capital A which I assume to represent the algorithm, but then level 14 reloaded with a message at the bottom saying "You have lost the Algorithm!" Re-completing the level works, but the same thing happens, as many times as I like; the last time, I saw "run 17_pointers.jsx" scroll past, but still got the map and code for level 14. My solution to level 14 [1] involved a state variable on the me object; could that have broken something? [1] https://gist.github.com/anonymous/8e4f11c26e5e6fe3d7d6 https://gist.github.com/anonymous/8e4f11c26e5e6fe3d7d6
- alnis 13y agoThis seems to be tied to a bug some other people have experienced where new levels don't load correctly and are overwritten with existing levels. Try going to level 15 and resetting the level (Ctrl-4). Does that help at all?
- aaronem 13y agoIt does! Thanks, and thanks for a fun, engrossing diversion on a rainy Monday afternoon. (Update: Each time I enter a level, it loads as level 13, and I have to reset it to get the correct map and code -- just a heads-up in case it helps with debugging. Chrome 33.something, Windows 7 x64.)
- arcatek 13y agoVery fun, however once I reached the level with the DOM, I catched the opponent but the game went crazy and submitted a lot of queries to Gist (when I closed the tab, the counter was at 64, and Github was serving 403).
- columbo 13y agoThat was great, Here's making the boss kill itself https://gist.github.com/anonymous/2d45242a73f72847417b https://gist.github.com/anonymous/2d45242a73f72847417b
- zenojevski 13y agoMuch earlier but: defense by excessive reaction. https://gist.github.com/anonymous/0bd9b9d36892ffe6dbbf https://gist.github.com/anonymous/0bd9b9d36892ffe6dbbf
- alnis 13y agoThese are both beautiful.
- jacereda 13y agoNon-violent solution: https://gist.github.com/anonymous/af2da1fb4ab84945e129 https://gist.github.com/anonymous/af2da1fb4ab84945e129
- pritambaral 13y agoLevel 6 can be cleared without modifying the code at all: http://home.iitb.ac.in/~pritambaral/level6.mp4 http://home.iitb.ac.in/~pritambaral/level6.mp4 (16K) http://home.iitb.ac.in/~pritambaral/level6.webm http://home.iitb.ac.in/~pritambaral/level6.webm (31K) http://home.iitb.ac.in/~pritambaral/level6.gif http://home.iitb.ac.in/~pritambaral/level6.gif (161K) EDIT: Seems to have been fixed. Leaving comment for archival purposes?
- phsource 13y agoSeems to have been fixed; I now see http://i.imgur.com/dQeC01W.png http://i.imgur.com/dQeC01W.png
- thret 13y agoLevel 6 doesn't work for me at all. I can get there several ways but the exit doesn't function. Also, is it possible for counter drones to kill the red drone? Mine wouldn't, all they do is block him.
- DocG 13y agoTHANK YOU. I have 0 knowledge about writing all kinds of code. This is perfect to start with. Specially thanks to the API part.
- neil_s 13y agoAny tips for level 9? I can't seem to find a handle on the raft to be able to modify its behaviour directly.
- paulhodge 13y agoIs there anything else you could modify to change what the raft does?
- 31cup 13y agoYes...but I can't do it at an intelligent time.
- alnis 13y agoDo you have any tools available to you that let you execute code at a chosen time?
- 31cup 13y agohah, I tried that multiple times, i get: You are not allowed to use call!
- alnis 13y agoDon't forget about the function phone! :-)
- nhaehnle 13y agoYeah, it seems odd that the setPhoneCallback is forbidden in this level, because that solution would fit the sequence of levels very well. Luckily, there are other ways to cross the water, and some other commenters in the thread already hinted at them ;)
- alnis 13y agosetPhoneCallback works perfectly for me in level 9 -- in fact, it's my intended solution: https://gist.github.com/anonymous/6e5606649b3cb0d60797 https://gist.github.com/anonymous/6e5606649b3cb0d60797
- Jupiterlyght 13y agodang this is awesome
- frankienwafili 13y agoIn order to fix that short delay before movement when you hold down a movement direction you should make pressing the arrow keys set a corresponding movement boolean to true. Then just move whenever the boolean is true. Great game!
- tyilo 13y agoI didn't get the last 3 DOM-based ones. I just randomly hit my arrow keys and until I completed the levels. Otherwise a very cool game!
- pacofvf 13y ago:'( I'm stuck at crispsContest.js lvl
- aaronem 13y agoSo was I, until I took another close look at the code. It's easy to miss the part you can edit.
- majugi 13y agoThis level was driving me crazy (mostly because of the character limit). The solution that I found is kind of silly: it turns out the removeItem function is dumber than you probably think it is.
- SheeEttin 13y agoA good solution would be to remove an invalid item, and the function should silently try to remove the invalid item, but still allow passage. For some reason, even when you have the green key, but try to remove an invalid item, it still doesn't let you through, despite apparently returning false (passable). Additionally it doesn't support injection there, so while "player.removeItem('greenKey'); player.additem('greenKey');" should work, it says "TypeError: undefined is not a function".
- Lozzer 13y agoI thought https://gist.github.com/anonymous/cfe03f2ddb0052b38081 https://gist.github.com/anonymous/cfe03f2ddb0052b38081 was kind of neat, as you still have to solve the puzzle a bit after using it.
- 9193-on 13y agoI approached it like this: player.removeItem('greenKey'); return 0;} if(1==1){(''); Full link: https://gist.github.com/anonymous/c78b439d8f2369e03f68 https://gist.github.com/anonymous/c78b439d8f2369e03f68 Basically, this let's you delete the green item once. After that, it makes sure that return true is never reached (because of the 1==1), so next passages through green are allowed. Kinda liked the sneaky (''); myself :P
- jbeja 13y agoI reach level 60, says the counter(just because the game buged after i try to clear level 6): http://imgur.com/ty9JlXz http://imgur.com/ty9JlXz.
- prawks 13y agoSame thing happened to me on level 9 (I think?): http://i.imgur.com/eYHoebE.png http://i.imgur.com/eYHoebE.png
- marijn 13y agoSeems to be overloaded now. Multiple 503s.
- ajanuary 13y agoThe level files are 503ing, but it looks like the level counter is still incrementing if I go out of the exit and back in again. You might want to add some response code validation in. GET http://alex.nisnevich.com/untrusted/levels/10_ambush.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/11_robot.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/12_robotNav.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/13_robotMaze.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/14_crispsContest.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/15_exceptionalCrossing.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/16_lasers.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/17_pointers.jsx 503 (Service Unavailable) jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/19_documentObjectMadness.jsx net::ERR_CONNECTION_REFUSED jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/20_bossFight.jsx net::ERR_CONNECTION_REFUSED jquery.min.js:6 GET http://alex.nisnevich.com/untrusted/levels/21_endOfTheLine.jsx net::ERR_CONNECTION_REFUSED
- alnis 13y agoSadly, our server couldn't handle the load. I've set up a mirror at: http://alexnisnevich.github.io/untrusted/ http://alexnisnevich.github.io/untrusted/ We're currently working on handling the AJAX responses more robustly. The level counter should no longer increment on a failed request.
- Natsu 13y agoThanks for the fun game! Could you possibly help us by putting in a ruler that marks the map coordinates? Yes, I can read the code to find where things are (or count), but there were a few times where it was somewhat inconvenient.
- alnis 13y agoThanks for the feedback! We've been thinking about doing that, but the challenge is making it inconspicuous enough to not clash with our minimalist aesthetic.
- alnis 13y agoHey guys, one of the developers here. Thank you all so much for all of your feedback! I never thought this game would become so popular. It seems that our server is more or less overloaded right now, so AJAX requests for new levels are sometimes failing. This appears to be the cause of the bugs that some of you have experienced where levels load incorrectly or are overwritten by previous levels. Sorry about that. :-/ We will work on making the game more robust in the case of failures like this. If you want to run the game locally, you can clone it from https://github.com/AlexNisnevich/untrusted https://github.com/AlexNisnevich/untrusted and follow the instructions there.
- GhotiFish 13y agowelp. it's 100% dead now. Sorry about that. That's what you get for making something really interesting and posting about it on hacker news.
- ihaveqvestion 13y agoI installed the latest version of this, and of Node, on my Windows computer, and I had to change "~/node_modules" to "./node_modules" in the final line of Makefile (in the "runlocal" target) - the http-server module was installed in the current directory. Otherwise it's working great; thanks!
- na85 13y agoWhen I exit level 1 it just re-loads level 1... is this the bug you're referring to?
- bayonetz 13y agoA simple nuclear trick for LvL two and on: http://pastebin.com/c7vqzrU3 http://pastebin.com/c7vqzrU3
- christiangenco 13y agoI love this game! Such a cool idea, and very well executed. My biggest critique so far is that it's extremely hard for me to tell the difference between #311 and #000 for the `.disabled` lines (I'm mildly red-green colorblind). Changing it to #711 fixed it for me, but I can imagine it would be impossible to even see #F11 for certain colorblind individuals. Perhaps some other kind of indication that a line is editable, or a more drastic #FFF/#000 distinction?
- resist_futility 13y agoHighlighting the text was really the only way I found some of the edit boxes.
- alnis 13y agoThis is definitely something we'll work on! I'm sorry that it was difficult to tell which lines were editable. Maybe we should add a contrast slider of some kind?
- Natsu 13y agoThat can be solved without changing the colors of anything, BTW :)
- Natsu 13y agoI just realized that I misread you and it's too late to edit. You're talking about lines of source code (and I do agree, I was really confused on the level where you can only edit a tiny section of code I missed), whereas I thought you were referring to the lasers puzzle (I just moved the exit for that).
- icedog 13y agoLevel 1 just reloads after I get to the exit.
- tibbon 13y agoSame here, even when running locally. I just had it never paint the walls- that's the right solution right?
- alnis 13y agoThe game was broken for a bit, and it's possible that your saved state got corrupted. Try restarting the game by running localStorage.clear() in the JavaScript console, then refreshing the page. Does that fix it?
- tall 13y agolevel 35! https://gist.github.com/anonymous/25b4b4b56f844368a37c https://gist.github.com/anonymous/25b4b4b56f844368a37c here's to calling into the code behind using pattern matching and the nifty in operator
- jimmaswell 13y agoI forgot about comments on lvl 2 and used if(0){} and was wondering what the 4 was until I remembered //, hah
- BostX 13y agoIn level 10 ambush I set function (me) {} for the red and yellow drones and function (me) { var r = 'right:'+me.canMove('right'); var l = 'left: '+me.canMove('left') alert(r+'; '+l); } for the green drones. But I always get 'right:true; left: true'. WTFFFFFF? :-( Please please fix that, please!!!
- mszmszmsz 13y agoLevel 10 can be solved by code injection :) https://gist.github.com/anonymous/d65048c34bd6874478a1 https://gist.github.com/anonymous/d65048c34bd6874478a1
- anigbrowl 13y agoLoved it, but exiting on Level 1 just causes level 1 to reload for me and never unlocks level 2.
- alnis 13y agoDoes the mirror [http://alexnisnevich.github.io/untrusted/ http://alexnisnevich.github.io/untrusted/] work for you?
- alnis 13y agoAttention! The main site is overloaded, but I've set up a mirror at: http://alexnisnevich.github.io/untrusted/ http://alexnisnevich.github.io/untrusted/ All level-loading issues should be resolved on it, since they were tied to AJAX failures. Let me know if you experience any problems on the mirror site.
- resist_futility 13y agoAny tips on level 15? Once the player is killed what could I possibly do?
- alnis 13y agoThe level filename is a hint.
- cheepin 13y agoI actually figured something out with this which is weird, because I don't think it has to do with exceptions. I passed in a new object of an undeclared type and just walked across the water, which I can't explain. Can anyone help?
- wingerlang 13y agoI think that's the purpose, the filename says something about "exception".
- SheeEttin 13y agoI'm trying with player.killedBy(function(){throw new Exception();}); ...but then that just means I get killed by "function(){throw new Exception();}". Edit: never mind, got it. Overriding onCollision helps. :) https://gist.github.com/anonymous/2868beb0cee19259ebb5 https://gist.github.com/anonymous/2868beb0cee19259ebb5
- rooodini 13y agoyou can close the bracket and inject some more commands… although you don’t have many characters in which to do it.
- Lord_DeathMatch 13y agoI can't figure it out either; i know that if you raise an exception in the area you can edit, it gets caught a few levels up where the toString representation of whatever you threw is parsed into status update info, with newlines interpreted correctly. But after that, even if you input chars that could build a bridge, it's not persisted to the next attempt :/
- davearch 13y agoThis is awesome but it keeps repeating the first level! I get the solution but then it just reloads everything.
- alnis 13y agoThe game was broken for a bit, and it's possible that your saved state got corrupted. Try restarting the game by running localStorage.clear() in the JavaScript console, then refreshing the page. Does that fix it?
- Ellipsis753 13y agoDoes anyone know of a nice way to unlock levels for the mirror? I'm on the first jQuery one but all I see is black text on a white screen. No players and nothing changes when I use the arrow keys. I can't find anything in the code I can edit either. I'd like to try the mirror but I don't want to have to play though the whole game again?
- alnis 13y agoCan you show me what the jQuery level looks like for you? I want to make sure that it's working correctly.
- Ellipsis753 13y agoIt's fixed now with the servers no longer overloaded (although for some reason I had to start again). What was happening was that the highlighting of you and the boss were not showing. So just the page without anything interactive.
- resist_futility 13y agoAnybody 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.
- chacham15 13y agoAm I the only one spending more time on figuring out how to cheat than actually doing the level the way you are supposed to?
- Dou8Le 13y agoChrome seems to crash every four or five levels and it forces me to reload the page. It's a tad annoying going back through my levels. Perhaps consider a level select, since it's able to remember your solutions?
- alnis 13y agoThere is a level select! :-) It's in the Menu (Ctrl-0). We really should bring more attention to it.
- cproctor 13y agoI won!
- cbhl 13y agoThis must be resulting in a lot of new gists on GitHub... is it odd that I wish I could sign in with my GitHub account so that the level saves showed up as gists under my name?
- madvlad 13y agoNot sure if you noticed this yet or not, but it is possible to comment all code following an allowed block by leaving an open "/*". This allows the player to write their own code to overwrite what should be uneditable. not sure if you would want to disallow this or not, but i find it allows for some interesting hacky solutions.
- crawfordcomeaux 13y agoHow long before "Twitch plays Untrusted"?
- deleted 13y ago[deleted]
- cheepin 13y agoaww, I tried to sacrifice my phone for an easier solution for the last problem, but apparently I need it in the end.
- jasonkester 13y agoAwesome game. One thing it drives home for me is just how distracting music is when I'm trying to code. It pulled up that first listing and I literally could not parse it until I muted the audio. Then it immediately turned back into code. It's like music just turns off the switch that connects the eyeballs to the brain. Amazing.
- wingerlang 13y agoAny way I can go to a level directly? I was on level 12 but my computer died, and it did not save any progress.
- ekmartin 13y agoDid you check the menu at ^0?
- wingerlang 13y agoAh, they were saved there! Thanks!
- kccqzy 13y agoI actually used a "private API" in level 14, crisps contest. https://gist.github.com/anonymous/dacd3f1de73a59b5983e https://gist.github.com/anonymous/dacd3f1de73a59b5983e Is this cheating?
- alnis 13y agoOoh, good catch! player.pickUpItem should definitely be renamed to player._pickUpItem and not made available to the player.
- shawabawa3 13y agoI completely cheated (added an extra key by setting a trace in the console) because I looked for an editable line for about 10 minutes and couldn't find it. Solved it now by changing greenKey to theAlgorithm
- swordsmith 13y agoCould you explain how you would do this? There doesn't seem to be an editable line, what's the trick?
- kccqzy 13y agoYep the line itself is not editable but the string argument to player.removeItem is editable. The code as given: player.removeItem('greenKey'); My "solution": Append the following text at the end of greenKey: ');player.pickUpItem('greenKey',' Final code: player.removeItem('greenKey');player.pickUpItem('greenKey',''); But currently this hack no longer works.
- fijter 13y agoVery cool game, thanks :) One minor issue in the API docs: canvasContext.beginPath() Begins drawing a new shape. canvasContext.beginPath(x, y) Sets the end coordinates of a line. this second beginPath should be lineTo, took a minute to debug in level 16 :)
- toxine 13y agolineTo doesn't work anymore so level 16 is broken :'(
- deleted 13y ago[deleted]
- antimagic 13y agoHere's an Iron Man inspired solution for the boss battle :) map.placeObject(map.getWidth()/2, 5, 'block'); //map.placeObject(map.getWidth()/2, 1, 'block'); var player = map.getPlayer(); map.defineObject('missile', { 'type': 'dynamic', 'symbol': '^', 'color': 'blue', 'interval': 100, 'projectile': true, 'behavior': function (me) { me.move('up'); } }); function jericho() { var i; for (i = 3; i < map.getWidth() - 3; i++) { map.placeObject(i, map.getHeight() - 1, 'missile'); } } player.setPhoneCallback(function() { jericho(); });
- ryanjshaw 13y agoFor the truly lazy, this was my approach: map.overrideKey('up', function() { if (map.countObjects('boss') > 0) { for (var x = 0; x < map.getWidth(); x++) { map.placeObject(x, map.getHeight()-5, 'missile'); } } else { map.overrideKey('up', null); } });
- antimagic 13y agoNice. Lacks drama though, where's the dash through the rain of bullets to recover the missile launcher? :D
- pygy_ 13y agoI monkey-patched Math.random() to launch horizontal missiles at the top of the screen and always return 1. :-)
- TheSoftwareGuy 13y agoInteresting, probably much simpler than my approach:(I have added a few comments to give a brief explanation: //Math.random = function(){ return false;}; /* my first Idea was to try and redefine Math.random to always return <0.3, but for some reason even though this did effect the dropping of bullets, it didn't stop them completely (if someone could explain this I would really appreciate it*/ map.defineObject('MagicBlock', { 'type' : 'static', 'symbol' : '$', 'color' : 'magenta', 'impassable' : function() { return map.countObjects('boss') >0;} }); //place a row of MagicBlock's aboove the player's starting position for(var i =0; i < map.getWidth(); i++) map.placeObject(i, map.getHeight()-5, 'MagicBlock'); map.defineObject('missile', { 'type' : 'dynamic', 'symbol' : '^', 'interval' : 100, 'projectile': true, 'behavior' : function(me) { me.move('up');}, 'color' : 'lime' }); player = map.getPlayer(); function volley(){ for(var i = 0; i < map.getWidth(); i++) map.placeObject(i, map.getHeight()-6, 'missile'); map.placeObject(i, map.getHeight()-7, 'missile'); } map.getPlayer().setPhoneCallback(function(){ volley(); });
- epsylon 13y agoIs there any solution to the ambush level other than the obvious solution of moving the drones out of the way?
- SheeEttin 13y agoOf course. I made them harmless and walked right through them.
- epsylon 13y agoTried that, but for some reason I couldn't disable the onCollision by assigning it to some dummy function. Do you mind sharing your solution?
- SheeEttin 13y agoI wish we could retrieve the solution we used for past levels. :( Okay, I think I've replicated it. I just overrode onCollision with empty braces, so the final definition looked like this: map.defineObject('attackDrone', { 'type': 'dynamic', 'symbol': 'd', 'color': 'red', 'onCollision': function (player) { player.killedBy('an attack drone'); }, 'behavior': function (me) { }, 'onCollision': function (player) { } }); Note that you're closing the game's braces, inserting another definition, then re-opening braces to match the game's closing ones.
- icemelt8 13y agoStuck at level 13 :(
- riverjiang 13y agoAny tips for level 17? I can't seem to figure out a solution for the teleporters using the getObjectCoords hint that was given
- joeframbach 13y agoYou can re-target the teleporters. And several teleporters can target one teleporter. And you can iterate over all teleporters and check where they are. I've said too much.
- amoonki 13y agoI did it by drawing on the canvas to mark the way. (I'm trying not to spoil it, apologies if this is too vague).
- rfirnrohr 13y agoI'm stuck on the teleporters one as well. Can we please have another hint?
- dannysb 13y agoThis level is hard. It took me a while until I found the coords for the transporters I was looking for but in the end I done it :). tip: find the transporter from the spawn point and the one where the exits is and link them together
- throwawayLSKDNF 13y agoLevel 5 should have more mines. With only 75, the level is easily solved via https://en.wikipedia.org/wiki/Big_sky_theory https://en.wikipedia.org/wiki/Big_sky_theory
- segmondy 13y agoWhy, it's not about the number of mines, so long as there's a path, it's very easy to solve. The number of mines is irrelevant.
- Bartweiss 13y agoOn level 15, my deaths keep changing the editable window. I'll die and then the last several characters (4 I believe) of my code get swapped to uneditable until I reset. I'm also encountering a bunch of exceptions during game execution instead of at build, which are making things rather hard to beat. I'd list them but they vanish faster than I can read them.
- mszmszmsz 13y agoLevel 12: remote control! https://gist.github.com/anonymous/dd3e906ad36d87158528 https://gist.github.com/anonymous/dd3e906ad36d87158528
- YuMS 13y agoLV 20 Math.random = function() {return 1;} map.getPlayer().hasItem = function() {return true;}
- tripzilch 13y agoI solved the jump/gravity level without having to edit any code, dunno if that's supposed to be possible, but: if you press+hold the UP key, keyboard repeat rate will be fast enough that you "fly", allowing you to cross the gap (and even save yourself if you happen to fall in it). I also solved the DOM level without editing anything, I just pressed some keys and it transported me to the next level before I even had an idea what was going on. (im playing on Firefox / Linux, in case that makes a difference) Oh and thanks for this game, it's EXTREMELY COOL and I had a lot of fun playing it all the way to the credits screen (and I'm going to go back now to see if that's really the last level or not ...)