All Projects → ytiurin → Tetris

ytiurin / Tetris

Licence: mit
👾 The original TETRIS game simulator

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Tetris

Fluttergames
Flutter app for purchasing and renting games.
Stars: ✭ 182 (+63.96%)
Mutual labels:  game, demo
Duckhunt Js
DuckHunt ported to JS and HTML5
Stars: ✭ 390 (+251.35%)
Mutual labels:  game, audio
Cordova Plugin Nativeaudio
The low latency audio plugin is designed to enable low latency and polyphonic audio from Cordova/PhoneGap applications, using a very simple and basic API.
Stars: ✭ 220 (+98.2%)
Mutual labels:  game, audio
Game with cocoscreater
学习cocosCreator开发的小游戏,有贪吃蛇,flappy bird, 2048等
Stars: ✭ 122 (+9.91%)
Mutual labels:  game, demo
Soloud
Free, easy, portable audio engine for games
Stars: ✭ 1,048 (+844.14%)
Mutual labels:  game, audio
Awesome Python Applications
💿 Free software that works great, and also happens to be open-source Python.
Stars: ✭ 13,275 (+11859.46%)
Mutual labels:  game, audio
Ble examples
Additional examples to compliment TI's Bluetooth Low Energy Stack offerings.
Stars: ✭ 289 (+160.36%)
Mutual labels:  demo, audio
Kaetram Open
An open-source 2D HTML5 adventure based off BrowserQuest (BQ).
Stars: ✭ 138 (+24.32%)
Mutual labels:  game, demo
Gym Alttp Gridworld
A gym environment for Stuart Armstrong's model of a treacherous turn.
Stars: ✭ 14 (-87.39%)
Mutual labels:  game, demo
Arshooter
A demo Augmented Reality shooter made with ARKit in Swift (iOS 11)
Stars: ✭ 794 (+615.32%)
Mutual labels:  game, demo
Cute headers
Collection of cross-platform one-file C/C++ libraries with no dependencies, primarily used for games
Stars: ✭ 3,274 (+2849.55%)
Mutual labels:  game, audio
Expo Three Demo
🍎👩‍🏫 Collection of Demos for THREE.js in Expo!
Stars: ✭ 76 (-31.53%)
Mutual labels:  game, demo
Vgmstream
vgmstream - A library for playback of various streamed audio formats used in video games.
Stars: ✭ 524 (+372.07%)
Mutual labels:  game, audio
Genshin Audio Extractor
Convert Genshin Impact audio files into a playable format
Stars: ✭ 54 (-51.35%)
Mutual labels:  game, audio
D3 Audio Spectrum
Spectrum analysis demo using D3 and HTML5 audio
Stars: ✭ 101 (-9.01%)
Mutual labels:  demo, audio
Dungeon
Text-based open-world RPG made with Java
Stars: ✭ 109 (-1.8%)
Mutual labels:  game
Sbplayerclient
支持全格式的mac版视频播放器
Stars: ✭ 110 (-0.9%)
Mutual labels:  audio
Darkfo
DarkFO, a post-nuclear RPG remake (of Fallout 2)
Stars: ✭ 109 (-1.8%)
Mutual labels:  game
Vue Meizi
vue最新实战项目,vue2 + vuex + webpack + es6 干货多多,新手福利
Stars: ✭ 1,476 (+1229.73%)
Mutual labels:  demo
Dddplus Demo
♨️ Demonstrate how to use DDDplus to build a complex OMS.演示如何使用DDDplus实现一套订单履约中台OMS
Stars: ✭ 111 (+0%)
Mutual labels:  demo

Demo GIF

Play 🎮 TETRIS

I made this small project to simulate the original 1984 version of TETRIS game. I saw a Youtube video showing the gameplay of this classic run on DVK-2 computer and thought I could implement it in browser and have some fun in the process.

To make it look similar to the old game, I made it entirely text based, meaning that every frame of the game animation is rendered into a string of text with 25 rows of 80 chars and looks like this:


ROWS HIT:             11    ‹! . . . . . . . . . .!›                            
SCORE:               980    ‹! . . . . . . . . . .!›      UP ARROW: ROTATE      
LEVEL:                 2    ‹! . . . . . . . . . .!›    DOWN ARROW: SOFT DROP   
                            ‹! . . . .▮▮ . . . . .!›      SPACEBAR: HARD DROP   
                            ‹! . . . .▮▮▮▮ . . . .!›        ESC, P: PAUSE       
                            ‹! . . . .▮▮ . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                    ▮▮▮▮▮▮▮▮‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . . . . .!›                            
                            ‹! . . . . . . .▮▮▮▮▮▮!›                            
                            ‹!▮▮▮▮ . . .▮▮ .▮▮▮▮▮▮!›                            
                            ‹!▮▮▮▮ .▮▮▮▮▮▮▮▮▮▮▮▮▮▮!›                            
                            ‹!====================!›                            
                              \/\/\/\/\/\/\/\/\/\/                              

Basic setup code:

TETRIS.on({
  nextFrame: function( frame ) {
    // replace HTML special chars
    frame = frame.replace( /[ <>]|\n\r/g, function( m ) { return {
      " ": "&nbsp;",
      "<" : "&lsaquo;",
      ">" : "&rsaquo;",
      "\n\r" : "<br>" }[ m ] })

    document.body.innerHTML = frame
  }
})

addEventListener( "keydown", function( e ) {
  TETRIS.pressKey( e.keyCode )
})

Check the play.js for more advanced code.

Audio

I extracted some audio effects from the original video and integrated them into the demo using Web Audio API.

Progressive Web App

The play page is served as a PWA, so you can play the game offline.

Leaderboard

I also made a simple microservice to store best scores of the play page.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].