This isn't even close to finished, I have a ton more to add. I have temporarily disabled comments, they will be back once I finish the game / release it to be played. I hope to add a good bit more stuff once it's released, so do expect updates!
//console.log(`Woah there! That shouldn't have happened! Please, copy and paste this into the comments!\nVersion: ${VERS}, \nDate: ${date.getMonth()}/${date.getDate()}/${date.getFullYear()}\nError: ${err}`)
9
//}
10
11
/*
12
--- UPDATE LOG ---
13
V0.1 - Release (3/5/24)
14
V0.2 - Fixed score bug (x2), and fixed upgrade scroll bar (3/9/24)
“Clicker Game [DRAFT]” by LoganPaxton
https://openprocessing.org/sketch/2232260
License CreativeCommons Attribution NonCommercial ShareAlike
https://creativecommons.org/licenses/by-nc-sa/3.0
{{filePath}}
{{width}} x {{height}}
Report Sketch
Oh, that naughty sketch! Please let us know what the issue is below.
Apply Template
Applying this template will reset your sketch and remove all your changes. Are you sure you would like to continue?
Report Sketch
Report Comment
Please confirm that you would like to report the comment below.
We will review your submission and take any actions necessary per our Community Guidelines. In addition to reporting this comment, you can also block the user to prevent any future interactions.
Please report comments only when necessary. Unnecessary or abusive use of this tool may result in your own account being suspended.
Are you sure you want to delete your sketch?
Any files uploaded will be deleted as well.
Delete Comment?
This will also delete all the replies to this comment.
Delete this tab? Any code in it will be deleted as well.
Select a collection to submit your sketch
We Need Your Support
Since 2008, OpenProcessing has provided tools for creative coders to learn, create, and share over a million open source projects in a friendly environment.
Niche websites like ours need your continued support for future development and maintenance, while keeping it an ad-free platform that respects your data and privacy!
Please consider subscribing below to show your support with a "Plus" badge on your profile and get access to many other features!
Click to gain money, press S to open the shop.
CC Attribution NonCommercial ShareAlike
Clicker Game [DRAFT]
xxxxxxxxxx
let button, score, multiplier, str, spacing_score, spacing_multi, shop_open, pos;
let VERS = 0.2
let date = new Date()
//function error(err) {
// console.log(`Woah there! That shouldn't have happened! Please, copy and paste this into the comments!\nVersion: ${VERS}, \nDate: ${date.getMonth()}/${date.getDate()}/${date.getFullYear()}\nError: ${err}`)
//}
/*
--- UPDATE LOG ---
V0.1 - Release (3/5/24)
V0.2 - Fixed score bug (x2), and fixed upgrade scroll bar (3/9/24)
------------------
*/
score = 0;
multiplier = 0;
str = 0;
shop_open = false
pos = 25;
function setup() {
createCanvas(windowWidth, windowHeight)
background(100)
button = createButton("")
button.size(200, 100)
button.position(windowWidth / 2 - 145, windowHeight / 2)
let maxHeight = 20
let minHeight = windowHeight
}
function debug() {
console.log("Click")
}
function increaseScore() {
if (multiplier <= 0) {
score += 1
} else if (multiplier >= 1) {
score += multiplier
}
}
function draw() {
button.mouseClicked(increaseScore)
background(220)
textSize(24)
str = `Score: ${score}`
spacing_score = windowWidth / 2 - textWidth(str)
str = `Multiplier: x${multiplier}`
spacing_multi = windowWidth / 2 - textWidth(str) + 20
text(`Score: ${score}`, spacing_score, 20)
text(`Multiplier: x${multiplier}`, spacing_multi, 45)
if (shop_open) {
drawShop()
checkPos()
}
}
function keyTyped() {
if (key === "s") {
if(shop_open === false) {
shop_open = true
} else if (shop_open === true) {
shop_open = false
}
}
}
function checkPos() {
if (pos < 25) {
while (pos < 25) {
pos += 1
}
} else if (pos > windowHeight - 25 ) {
while (pos > windowHeight - 25) {
pos -= 1
}
}
}
function drawShop() {
let container, scroll_bar;
container = rect(0, 0, 200, windowHeight) // X, Y, W, L
text("Upgrades", 45, 25) // STR, X, Y
scroll_bar = rect(25, pos, 10, 25)
}
function mouseWheel(event) {
pos += event.delta
return false;
}
See More Shortcuts
Please verify your email to comment
Verify Email