-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
A game when claude roleplayed a child
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>My Click Score Game</title> | ||
<style> | ||
body { | ||
background-color: #f0f8ff; /* Light blue background */ | ||
font-family: Arial, sans-serif; /* Makes the text Arial font */ | ||
} | ||
h1 { | ||
color: #ff4500; /* Orange color for the score */ | ||
} | ||
button { | ||
background-color: #4CAF50; /* Green background for the button */ | ||
color: white; /* White text */ | ||
padding: 15px 32px; /* Makes the button bigger */ | ||
text-align: center; | ||
font-size: 16px; | ||
margin: 4px 2px; | ||
cursor: pointer; /* Changes the mouse cursor to a pointer when over the button */ | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>Score: <span id="score">0</span></h1> | ||
<button onclick="increaseScore()">Click me to score!</button> | ||
<audio id="mySound"> | ||
<source src="click-sound.wav" type="audio/mp3"> | ||
</audio> | ||
<script> | ||
var score = 0; // This keeps track of your score | ||
|
||
function increaseScore() { | ||
var pointsToAdd = Math.floor(Math.random() * 3); | ||
if (pointsToAdd === 0) { | ||
pointsToAdd = 1; | ||
} else if (pointsToAdd === 1) { | ||
pointsToAdd = 5; | ||
} else { | ||
pointsToAdd = 10; | ||
} | ||
|
||
score += pointsToAdd; | ||
document.getElementById('score').innerHTML = score; | ||
document.getElementById('mySound').play(); | ||
|
||
var colorIndex = Math.floor(Math.random() * colors.length); | ||
document.querySelector('button').style.backgroundColor = colors[colorIndex]; | ||
|
||
// Check if score is 50 or more and display a message | ||
if (score >= 50) { | ||
alert("Wow, you got to 50 points! Good job!"); | ||
} | ||
} | ||
var colors = ['red', 'blue', 'green', 'yellow', 'purple', 'orange']; // Add more if you like! | ||
|
||
</script> | ||
</body> | ||
</html> |