I’m working on a school project where we have to develop our own game. I’m making a kind of Minecraft Cookie Clicker, but instead of cookies, it’s diamonds, and instead of grandmothers, farms, mines, etc., it’s the wooden, stone, iron, and diamond pickaxes from Minecraft. The goal of the game is to reach 100,000 diamonds. There’s also a diamond ore to mine manually. The thing is, in the code section, I generated four variables that are initially set to 0, one for each pickaxe. Each time you buy another pickaxe, it’s added to your total diamonds after some calculations. The problem is that it works fine when you buy one, but when you buy more (the problem appears after four), it starts giving you a number of diamonds that doesn’t correspond at all to what it should. I’m also sharing the link to the project because it’s better to see it than read about it. Just so you know, the project is in Spanish because I’m from Spain. This is it: https://x.thunkable.com/copy/2e204b454ddcf09fa01dc9e7a378a22c
By the way, in that app, there are two games. The one I’m talking about is called “Paga tu deuda.” The other one is in development, but I’m also open to suggestions for it because it’s not working for me either.
@joellopezdiaz What is not working, or what feature are you trying to build?
In the code section, there are 4 variables that are initially set to 0. Each time you buy one of the automation tools (the pickaxes), the corresponding number of diamonds you should receive is added to its respective variable. For example, the wooden pickaxe variable is the easiest to explain because each time you buy one, the variable is incremented by 1. So far, so good. The problem is that in-game, if you start buying wooden pickaxes, you should get 4 diamonds after buying 4, but suddenly you get 508 (I made up the previous number, but it’s not an exaggeration) furthermore, the more you buy, the more absurd the difference becomes; you might buy 10 and they start giving you millions or thousands at least.
And the same thing happens with all the pickaxes and their variables.
(If there are any spelling mistakes in this message, it’s because of the translator, and if I get temporarily muted for typing too fast, it’s because I copied and pasted this from the translator.)
In fact, I need to find a solution before Tuesday, or at the latest Wednesday.
@joellopezdiaz
Instead of the Change Variable Block, use the Set Variable Block.
I’m assuming you want to build the following logic:
App variable los que = App variable los que + 1
Right now, this is what your block does:
App variable los que + App variable los que + 1
When you use Change, it adds the right-hand side to the variable.
Thank you, I’ll update it in a little while.
And thank you so much for your time.
It works.
Thanks