Skip to content

Commit

Permalink
in-block view
Browse files Browse the repository at this point in the history
  • Loading branch information
L3P3 committed Sep 9, 2024
1 parent 2a552f9 commit 1332eaf
Show file tree
Hide file tree
Showing 5 changed files with 329 additions and 280 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "minicraft",
"version": "0.11.1",
"version": "0.11.2",
"description": "voxel-based 3d game, written in javascript",
"homepage": "https://l3p3.de/minicraft",
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion src/etc/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,14 @@ export const BLOCK_COLORS = [
0xe3eaed, // QUARTZ_BLOCK
];

export const BLOCK_TYPE_FACE_LABELS = 'WEBTSN'.split('');
export const BLOCK_TYPE_FACE_LABELS = 'WEBTSNI';
export const BLOCK_TYPE_FACE_W = 0;
export const BLOCK_TYPE_FACE_E = 1;
export const BLOCK_TYPE_FACE_B = 2;
export const BLOCK_TYPE_FACE_T = 3;
export const BLOCK_TYPE_FACE_S = 4;
export const BLOCK_TYPE_FACE_N = 5;
export const BLOCK_TYPE_FACE_I = 6;

export const SKY_COLOR = 0xffb184;

Expand Down
2 changes: 1 addition & 1 deletion src/game/c_settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export default function Settings({
}),
]),
node_dom(`label[innerText=${locale_pixel_grouping}:]`, null, [
node_dom('input[type=range][min=1][max=6][step=1]', {
node_dom('input[type=range][min=1][max=8][step=1]', {
value: config.pixel_grouping,
onchange: event => (
config_set({
Expand Down
3 changes: 2 additions & 1 deletion src/game/m_game.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
BLOCK_TYPE_DIRT,
BLOCK_TYPE_FACE_B,
BLOCK_TYPE_FACE_E,
BLOCK_TYPE_FACE_N,
BLOCK_TYPE_FACE_S,
BLOCK_TYPE_FACE_T,
BLOCK_TYPE_FACE_W,
Expand Down Expand Up @@ -455,7 +456,7 @@ export const game_key = (model, code, state) => {
case BLOCK_TYPE_FACE_B: --y; break;
case BLOCK_TYPE_FACE_T: ++y; break;
case BLOCK_TYPE_FACE_S: --z; break;
default: ++z;
case BLOCK_TYPE_FACE_N: ++z;
}
if (
y >= 0 &&
Expand Down
Loading

0 comments on commit 1332eaf

Please sign in to comment.