Get the nethack page looking good again
Update all the CSS classes and fix the layout so it looks good in the new theme. Convert a bunch of CSS classes to BEM style.
This commit is contained in:
parent
2b613de769
commit
d5296995de
10 changed files with 206 additions and 45 deletions
|
@ -402,11 +402,11 @@ class TunnelGenerator {
|
|||
}
|
||||
|
||||
/**
|
||||
* Dig a corridor from fromPoint to toPoint, assuming that both points are adjacent to valid locations for doors on
|
||||
* the map.
|
||||
* Dig a corridor from fromPoint to toPoint, assuming that both points are
|
||||
* adjacent to valid locations for doors on the map.
|
||||
*
|
||||
* This is as close a copy of dig_corridor in the Nethack source as I could muster. It's not exactly pretty. This
|
||||
* method assumed
|
||||
* This is as close a copy of dig_corridor in the Nethack source as I could
|
||||
* muster. It's not exactly pretty. This method assumed
|
||||
*/
|
||||
#digCorridorFromPointToPoint(p, fromPoint, toPoint) {
|
||||
const MAX_STEPS = 500;
|
||||
|
@ -711,6 +711,8 @@ new p5(p => {
|
|||
|
||||
p.setup = () => {
|
||||
const container = document.querySelector('#dungeon-background');
|
||||
console.assert(container, "Missing #dungeon-background element");
|
||||
|
||||
canvasWidth = parseFloat(getComputedStyle(container).width);
|
||||
canvasHeight = parseFloat(getComputedStyle(container).height);
|
||||
|
||||
|
@ -731,9 +733,11 @@ new p5(p => {
|
|||
|
||||
grid = new Grid(gridBounds.size.width, gridBounds.size.height);
|
||||
grid.generate(p, NRandomRoomsGenerator, TunnelGenerator);
|
||||
}
|
||||
};
|
||||
|
||||
p.draw = () => {
|
||||
console.log("Drawing");
|
||||
|
||||
p.textSize(CELL_HEIGHT);
|
||||
|
||||
for (let y = 0; y < grid.height; y++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue