Okay, serious code time now. I’m working on another game in my free time, and I need some help.

times_opened = parseInt(localStorage.getItem('times opened')) // loads the repl count, and places it on the screen// document.getElementById('counter').innerHTML = 'Repls: ' + repls function sleep (milliseconds) { const date = Date.now() let currentDate = null do { currentDate = Date.now() } while (currentDate - date < milliseconds) } if (times_opened = '') { repls = parseInt(0) parseInt(localStorage.setItem('times opened', parseInt(1))) } function changethiswhenworkingonstorage () { repls = parseInt(localStorage.getItem('replcount')) document.getElementById('counter').innerHTML = 'Repls: ' + repls }

This looks to me like code for a local storage system. I was not the one who wrote this; I had some people working with me on it a while back, but they are gone now and they just left this in this state. The game is a remake of cookie clicker with the theme of Replit.com, programmed from scratch with no engine.

I’ll define the variables here:

repls: the amount of “points” the player has; the equivalent to cookies in CC

“counter”: the display that shows the amount of repls one has.

replcount: unused variable

Sep 14, 2023, 2:42 PM
0 0 0

comments