Show HN: A tiny isometric city builder in JavaScript
github.com
github.com
Also: plebs are needed.
I've tried a lot of the newer city builders and the 3D just does not do it for me. I find it clunky and awkward.
Filling some of the whitespace with scrollable grid of pieces would go a long way towards decreasing time for piece selection.
Also, I suggest highlighting the currently selected piece.
Hmm, MIT license, this could be a kitchen planner for her :)
I also appreciate that you're very open to contributions! :)
Or, couldn't you pretend the city rotated but the sun didn't (like a model under a lamp), so lighting is the same for all orientations?
PS. Love your github tagline "I'm a Brazilian times better than your average coder." :)
https://jaygles.github.io/city-block/
Garbage newbie code for it here - https://github.com/Jaygles/city-block
Seems like some recent browser updates sort of broke the main animation but if you really want to see something fun open it in IE.
const $ = _ => document.querySelector(_)
Pretty well sums up the state of jQuery in 2019 (almost 2020!)
$ = function(_) { return document.querySelector(_) }
It basically turns `$` into an alias for `document.querySelector`. I'm not sure that it's any different from:
$ = document.querySelector
https://www.taniarascia.com/this-bind-call-apply-javascript/
For this specific case, you can see this at https://stackoverflow.com/q/13383886/8334056
$ = document.querySelector.bind(document);Btw, querySelectorAll() to match multiple elements.
* IE partial until 2011
Ok, you will say, but you can always do
[... document.querySelectorAll('.foo .bar')].map(it => it.style.backgroundColor = 'corn');
instead of $('.foo .bar').css('backgroundColor', 'corn');
and it is clearly better because it does not use jQuery.
Don't get me wrong, jQuery has many issues that make it a very poor choice for big modern web applications, but please don't tell me that it can be replaced by querySelectorAll.
I didn't, and it can't -- my comment was merely to suggest that jQuery is now a shell of its old self, thanks largely to the improvement of browser DOM APIs.
I'd also probably recommend using Array.from instead of a spread (for clarity) but less concerned about that part.
One of the last projects I did in college was a terrain generator.
After, I was learning a new programming language, so I picked it up again to experiment with some world building.
I started trying to generate more realistic (and traverseable) terrain. I had worked out coastlines and rivers, made some headway on biomes, and gotten stuck on simulated erosion before I remembered that I like games a little too much and didn’t want to make them for a living.
I was pretty bummed when No Man’s Sky was panned. Using generated terrain as a canvas and dropping a story into it still feels like the right long-term solution for exploration games.
source: https://github.com/victorqribeiro/isocity/blob/master/js/mai...
I thought about adding a print screen button
a save button that keeps the map on a localStorage would also be great
Suppose it should contain a mission where you need to answer a set of questions to proceed
Edit: Seems like there's an app for that.
Doesn't seem to implement rotation - it can reveal obscured objects. https://github.com/victorqribeiro/isocity/blob/master/js/mai...
map=Array(7).fill(Array(7).fill(3)).map((a,i)=>a.map((x,n)=>[0,i>3&&n<3?1:3]));drawMap()