Giter Site home page Giter Site logo

swng / zztetris Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aznguymp4/schoolteto

4.0 2.0 4.0 2.17 MB

a tetris client with a name that starts with zz so you can type zz and have it autocomplete

Home Page: https://swng.github.io/zztetris/

License: MIT License

HTML 22.74% JavaScript 75.21% CSS 2.05%

zztetris's Introduction

ZZTetris

Discord Shield Open issues Open PRs License Repo stars

Join the Project Discord!

Read the Docs!

A tetris client with a name that starts with zz so you can type zz and have it autocomplete

Forked from aznguy's schoolteto with a number of features added

Inspired by fio's four-tris

Features (probably buggy lol)

  • Fumen import/export
  • Image import works through clipboard
  • Undo/redo with board history
  • Full fumen import/export sets your board state history as the fumen pages and vice versa.
  • Drawing garbage on the board

TODO

  • fix DAS stuff more?
  • add alternate kick tables

zztetris's People

Contributors

aznguymp4 avatar g3ner1c avatar nur-hafiz avatar psychosomaticon avatar swng avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

zztetris's Issues

Incosistent keybinds on first broswer load

Browser and version

Chrome 99

Describe the bug/issue

Keybinds often don't work on the first browser load

Reproducing

Clear page cache or load page in Incognito mode

Expected behavior

Not this lol

Screenshots

No response

Console logs

Nothing in console

Additional context

Fixed after rebinding keys even if rebound to the same key

Infinite Hold

You can switch hold multiple times without dropping anything

Should be relatively easy fix with a variable tracking if the user previously held or not

Multiple keybinds to same function

Is your feature request related to a problem? Please describe.

Not really but TETR.IO supports it and there is no reason not to.

Describe the solution you'd like

A way to bind multiple keys to the same action. (eg. both ArrowUp and KeyZ binds to CW)

Describe alternatives you've considered

Not really any other way besides getting keyboard software or something to rebind the keys outside of the browser.

Additional context

Not high priority but worth adding later on in the future.

The current implementation of the controls is a Object with a single key input and an action as key/value pairs:

var ctrl = {

	ArrowLeft: 'L',
	ArrowRight: 'R',
	ArrowDown: 'SD',
	Space: 'HD',
	ShiftLeft: 'HL',
	KeyZ: 'CW',
	KeyX: 'CCW',
	KeyC: 'R180',
	KeyR: 'RE',
	KeyT: 'UNDO',
	KeyY: 'REDO',

};

A way to implement multiple keybindings is to invert this Object and add an Array of possible key inputs:

var ctrl = { // guideline settings

	'L': [ArrowLeft],
	'R': [ArrowRight],
	'SD': [ArrowDown],
	'HD': [Space],
	'HL': [ShiftLeft, KeyC],
	'CW': [KeyZ, ArrowUp],
	'CCW': [KeyX, ControlLeft],
	'R180': [KeyA],
	'RE': [KeyR],
	'UNDO': [KeyT],
	'REDO': [KeyY]

};

However, checking for inputs using this method will take significantly more time as more inputs are added.

An alternative method is to keep on using the key/value pair but allow users to add more pairs but prevent duplicate or conflicting binds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.