Colordle: a Color Guessing Game
by 1004589 in Design > Game Design
2057 Views, 2 Favorites, 0 Comments
Colordle: a Color Guessing Game
I made Colordle, A wordle inspired game where you are guessing colors instead of words.
How you Play: A random color is chosen and you have to find the red value, green value, and blue value of that color. Each value is a number from 0 to 255. Example if the color chosen is a orangey color, the values could be Red 232, Green 142, Blue 23. After each guess you are told if the actual value is higher, lower, or equal to the value you chose. Attached is a video of a full game.
Here is a link to the project if you want to play: https://scratch.mit.edu/projects/1256789423/
Downloads
Supplies
A computer.
Picking a Color
To pick a color you need to use the pen tool.
First, create variables for each Color value, then pick a random number from 0-255 for each of them. To get the pen to display the color use the equation "set pen color to (Red value*65536)+(Green value*256)+Blue value
Now just make the pen move and the color is now displayed.
Asking for Values
Now we have to ask the player for their guess of the values. To do that we have to first see if the previous guess was correct, if it is don't ask for the value. If it was wrong, then ask for a number from 0-255 (I put it in as round so someone could put in a decimal without any issues) If the number isn't within 0-255, report an error and ask again. Once the value has been submitted set a variable to that value, then broadcast that the value has been set, and to ask for the next value. Repeat this for each value.
Displaying Guesses
After you guess the values, we need a way to display your guess. To do this we create another pen with the color set to your previous guess. This is set to happen after you complete your guess on blue. (the final one) Afterwards we have to repeat the asking for values, so we broadcast that the guess is done and starts asking again. we also increase a guesses variable by 1 to show that there has been 1 more guess.
Higher or Lower
After you make the guess we have to show if the actual value is higher or lower. To do this, create 3 sprites, one for each color, and create 3 costumes for each. An arrow pointing up, An arrow pointing down, and an equals sign. we see if the value of the answer is higher, lower, or equal to your last guess for that color. If the answer is higher, show the up arrow. Lower show the down arrow. And equal show the equals sign. Repeat this for each color.
Ending
Once you make a guess where all answers are equal, we show that they are equal and that you have won the game. you can press the green flag to play again, or just leave.
That's it. All other code is just for aesthetic purposes, you should be able to make a working game without it by just following the code I showed.
To see all the code just go to the project on scratch and click on the "see inside" button. You can then see all the code for it.