Skip to content
Sign UpLog In
Profile icon

someNerd55665

@someNerd55665
Been coding in p5.js for a year or 2! Tried to learned html,css,js,and python but failed. :(
Repls
Community
someNerd55665
someNerd55665
published an Update
1 year ago
0
Zombie game
Zombie game
How to add and subtract a number from variable?
I'm trying to make a zombie game similar to COD Zombies, and I need to subtract a certain number of points from player.points how do I do that? Also if you could add the proper dist number that would be nice!
someNerd55665
someNerd55665
@JaspiDiceYT I mean if the player had (just an example) 5000 points and when you buy the perk it will subtract 2500 until it can't. Is there a way to stop that?1 year ago
JaspiDiceYT
JaspiDiceYT
@someNerd55665 You would need to check if the player has enough to get it: if (player.points < 2500) { console.log("Not enough points!"); break; }1 year ago
someNerd55665
someNerd55665
@JaspiDiceYT break doesn't work on if statements, I think it only works on for();1 year ago