My Website.

AriesNinja

Forum Master
VIP
AriesNinja
AriesNinja
VIP
Joined
Sep 20, 2020
Posts
502
Ratings
185 223
#1
I am now in the progress of making a Cookie Clicker!

I plan to add some unique features to mine to make it vary from the original cookie clicker.

Check It Out Here: https://cc-aries.web.app/

PS: I think it's broken right now 0.o

PSS: Staff if this is considered advertising you can delete it

PSSS: If you don't believe this is my site just ask and I'll do something about it for u.
 

curtis

Dedicated Member
curtis18264
curtis18264
Joined
Oct 19, 2019
Posts
180
Ratings
121 2
#2
I had a quick look at the code, and theres a lot of stuff you use that I've never learned about, so I don't know what most of your functions are trying to do. However, I found whats wrong with the score and made a solution. Firstly, the variable "score" isn't defined. Secondly, when you say:
var scoreE = document.getElementById("score");
...
scoreE = scoreE.innerHTML;

It is the same as saying:
var scoreE = document.getElementById("score").innerHTML;

This means that the variable scoreE can't be used as a shortcut to change the score counter on screen. Instead, you are just having it store whatever the text for the score counter was. To get around that, just remove the "scoreE = scoreE.innerHTML;" part. Whenever you need to change what the score counter says, just do:
scoreE.innerHTML = (some value here);

Basically, remove line 7 and replace "scoreE = score;" with "scoreE.innerHTML = score;" inside of the cookie.onclick event.

Also, the 3 times you use parseInt() inside of the gameloop function isn't necessary, but it still works either way. Good luck, coding is lots of fun and gets more fun the more you know!

(edited bc of a mistake)
 
Last edited:

Acrellux

Forum God
ELITE
Acrellux
Acrellux
ELITE
Joined
Jul 28, 2020
Posts
5,049
Ratings
1,364 147
#3
Okay that's really cool! Excited to see more projects for you and even though cc is broken rn I find it amusing so yay :) ;)
 

AriesNinja

Forum Master
VIP
AriesNinja
AriesNinja
VIP
Joined
Sep 20, 2020
Posts
502
Ratings
185 223
#4
I had a quick look at the code, and theres a lot of stuff you use that I've never learned about, so I don't know what most of your functions are trying to do. However, I found whats wrong with the score and made a solution. Firstly, the variable "score" isn't defined. Secondly, when you say:
var scoreE = document.getElementById("score");
...
scoreE = scoreE.innerHTML;

It is the same as saying:
var scoreE = document.getElementById("score").innerHTML;

This means that the variable scoreE can't be used as a shortcut to change the score counter on screen. Instead, you are just having it store whatever the text for the score counter was. To get around that, just remove the "scoreE = scoreE.innerHTML;" part. Whenever you need to change what the score counter says, just do:
scoreE.innerHTML = (some value here);

Basically, remove line 7 and replace "scoreE = score;" with "scoreE.innerHTML = score;" inside of the cookie.onclick event.

Also, the 3 times you use parseInt() inside of the gameloop function isn't necessary, but it still works either way. Good luck, coding is lots of fun and gets more fun the more you know!

(edited bc of a mistake)
Thanks! This really helped me.