Bug fixes

This commit is contained in:
asraelite 2018-03-09 20:07:31 +00:00
parent 17df8c0863
commit 8a0bf0ada9
10 changed files with 187 additions and 30 deletions

View file

@ -17,7 +17,9 @@ export const mapping = {
toggleTrace: 'KeyT',
toggleMarkers: 'KeyR',
toggleMusic: 'KeyM',
togglePause: 'KeyP'
togglePause: 'KeyP',
zoomIn: 'KeyZ',
zoomOut: 'KeyX'
};
let held, pressed;
@ -34,7 +36,17 @@ export function tick() {
if (!state.editing) {
if (input.mouse.scroll !== 0) {
graphics.changeZoom(-input.mouse.scroll);
// Fix for Firefox.
let delta = input.mouse.scroll > 0 ? -50 : 50;
graphics.changeZoom(delta);
}
if (held[mapping.zoomIn]) {
graphics.changeZoom(-10);
}
if (held[mapping.zoomOut]) {
graphics.changeZoom(10);
}
if (pressed[mapping.togglePause] && !state.gameOver) {

View file

@ -40,6 +40,8 @@ export function changeView(view) {
state.editing = false;
state.paused = false;
world.init();
edit.init();
graphics.perspective.reset();
inventory.init();
} else if (view === 'instructions') {
state.playing = false;

View file

@ -14,6 +14,7 @@ let onupdate = () => {};
export function init() {
items.clear();
update();
}
export function canToss() {