Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Randomized color scheme each game #24

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions js/script.js
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good job

Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
// DEFINE STACK COLOR
const colorDesign = [
[200, 80, 60],
[30, 70, 50],
];

// GAME DETAILS
let GAME_ = {
status: false,
Expand All @@ -12,11 +8,15 @@ let GAME_ = {
combo: 0,
bestResult: (window.localStorage.getItem('bestResult')) ? window.localStorage.getItem('bestResult') : 0,
newRecord: false, // TO RESET SCREEN
designPalette: Math.floor(Math.random()*(colorDesign.length))
designPalette: 0
}

// ==================================

// DEFINE STACK COLOR
const colorDesign = [
[200, 80, 60],
[30, 70, 50],
];

// DEFINE BOX SIZE
const boxSize = {
Expand Down Expand Up @@ -138,7 +138,7 @@ window.addEventListener('load', ()=>{

// RESET COLISION WORLD AND SCENE
function reset(){
// GAME_.designPalette = Math.floor(Math.random() * colorDesign.length);
GAME_.designPalette = Math.floor(Math.random() * colorDesign.length);

// CAMERA
camera.position.set(4, 4, 4);
Expand Down
2 changes: 1 addition & 1 deletion js/script.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.