alexnisnevich / untrusted Goto Github PK
View Code? Open in Web Editor NEWA meta-JavaScript adventure game by Alex Nisnevich and Greg Shuflin.
Home Page: http://alex.nisnevich.com/untrusted/
A meta-JavaScript adventure game by Alex Nisnevich and Greg Shuflin.
Home Page: http://alex.nisnevich.com/untrusted/
[Suggestion from Jordan]
well, we could do something like
overlay (real?) HTML elements over the game area canvas
and then present as the sekeleton code
just html
with a script tag
so there's the clue that DOM manipulation is what needs to happen
or maybe
for the last level
we abandon the roguelike environment altogether
and it's just the player
moving around on a html page
I'm thinking, like, build an obvious parody of facebook or google or some other popular website
with a lot of complexity in the dom
like, visual complexity, lots of differnet things happening on the page
and you have to move through it like a maze
This is just a note to myself to at some point go through the code and clean up formatting and perhaps stylistic things
e.g. robotMaze, pointers
[Feedback from everyone re: pointers and Devin re: robotMaze]
[Feedback from Devin]
(Feedback from Stephen.)
[Feedback from Conrad.]
I tried to solve the previous level in a way which allowed me to walk out with theAlgorithm, and it crashed on trying to load the next one. I tried reloading a couple of times, and discovered my character could still move, so I moved over the exit again and it incremented again. Doesn't look like it goes beyond that, but regardless, I can't seem to progress the level any further. I've tried refreshing the page and redoing level 15 as well as loading 16 separately and they all break with the same error.
I'm playing on Chrome Version 31.0.1650.63 m on Windows 8.1.
Commit that causes this: 6a5c7cf
[Suggestion from Jordan]
First off, I really enjoyed your game!
There is protection against the input block containing eval
, but it's not that hard to work around. I found it was as simple as calling new Function
on some string to run, but there are some other ways I found by just googling "eval without eval."
For example, on level 14 (crispsContest.js), the user-defined string can be defined like:
player.removeItem(''+new Function(prompt()).apply(map)+'');
and then at the textbox you just paste in the code:
this.placeObject(20, 10, 'theAlgorithm');
return 'greenKey';
which is too long to put by itself in the user-entered code area.
(As another issue, maybe validation on level 14 should include counts on theAlgorithm
?)
(As another issue, maybe you want to forbid prompt
and confirm
? Keeping alert
is nice for debugging without resorting to the browser inspector.)
This is really three issues in one:
and maybe even automatically make a gist with their solution or something
Other playability feedback: The naive check for return is frustrating. Not being able to use lambdas or helper functions, say for mapping the result of getAdjacentEmptyCells sucks. Potentially only error out if you see a return that is NOT in the primary match of /function(^))^{{(^})*}/
[Feedback from Philip]
It's silly that we don't do this already. Will allow players to look back at old solutions and facilitate sharing and stuff.
[Suggestion from Jordan]
Idea: maybe do a separate preprocessing step that converts Allman style indentation to K&R style indentation.
[Feedback from Philip]
jump
to complete it[as per conversation with Ryan F]
[Feedback from Alexander]
This should both help organization and provide a sipmle solution to preventing players from accessing verboten methods.
e.g. Game.prototype.addToInventory ...
.
Maybe wrap everything in an anonymous function?
[Feedback from Devin]
Feedback from Gilbert:
If I place an object that generates an exit after map generation, I can use the exit to get to the next level even though the map validation complains at me.
That would enable people to share solutions and stuff. It'll be great.
Dangerous functions (e.g. moveToNextLevel()) should not be able to execute while user code is being run (either on level execution or on callback).
Oh god, did I really just write that?
This should hopefully prevent madness like window['ev' + 'al']
.
[Based on feedback from Ryan]
getAdjacentEmptyCells as an api method seems less useful than just a getAdjacentCells, and letting the player filter by getObjectTypeAt, since as documented things like barriers are technically not empty, but passable, forcing me to have to code some special logic in case I'm on the last step in something like an acyclic depth-first search.
Another api method that would make code less hacky is to give a function for "object.positionAtDirection(direction)" which returns an x,y pair corresponding to the box at the specified direction. Much easier than the alternative of "testing" an adjacent square, which is tedious vector mapping.
[Feedback from Philip]
Feedback from Yuval:
found a bug on level 10 (I've been taking breaks between levels lol), there was a drone on top of the goal but I just rushed the goal and the screen said I was killed but the goal still triggered and I moved on to the next level
Should be fun to write, and will simplify the code for Crisp's Contest a fair bit.
Once we push live the solution-saving feature, we need to be able to override saved levels when we modify the level itself. A simple versioning system (clear localStorage for a given level if the current level file's version differs from the version saved in localStorage) ought to suffice.
[Suggestion from Jordan]
The bad news: CC-ND only permits you to use up to 30 sec samples of music as "fair use". We need to ask permission to use all of the CC-ND songs we have right now.
The good news: There are >18,000 electronic CC songs available at http://freemusicarchive.org/genre/Electronic/?sort=track_interest and most of them are not ND. We can look through it and see what works.
And I think Dmitry's working on music too.
[Feedback from essentially everybody]
another interesting thing! just moved ahead to level 21, but then went back to 20 to look at some code, and because it now reloads whatever your last code was it did that just fine... but because the original code only had 1 black editable line it loaded the rest of my code in the red zone so it's no longer editable... - Jordan
Maybe dump them into Map?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.