Making TETRIS
My progress of trying to make TETRIS
// html zone for later
var gameRunning = 0;
//variables for easy difficulty changes, settings options implemented later?
var time = 500; // change for initial speed in ms
var acceleration = 10000; // how long it takes before increasing speed in ms
function timer() {
time -= 50
};
function gravity() {
//gravity code poggers
};
function gameStart() { // do an onclick event on html button
gameRunning = 1
//change screen?};
while (gameRunning === 1) {
setInterval(timer, acceleration) // every ___ milliseconds the speed will increase
if (time >= 10) {
setInterval(gravity, time)
}
else {
setInterval(gravity, 10) // speed caps at 10ms
}
};
while (gameRunning === 0) {
// score screen or somethin
}
//ok like the timer works but it doesnt stop because i don't have a stop thing yet