March 16, 2022, 8:40pm
I have one variable counting how many of a certain block is on screen with text attached to it that displays how many are there, and another variable that I need to count up one every time that the first variable only counts down.
I have a deadline for this on March 18, 1:30 PM PST
I’ve been working on this for two days now.
(Also sorry if this is a repost, I just created my account like 35 seconds ago to type this up real quick.)
March 16, 2022, 9:40pm
So blocks_left is the count down value, and score is the count up value? If so, the following is what you’re after :
March 16, 2022, 10:26pm
Yes this seems right, i’ll test it when I have the time and get back to you. Thanks for the help.
March 18, 2022, 7:11pm
The code works fine for the most part, but I would like to have the ability to have the blocks regenerate on screen but have the score not reset every time they come back on screen. How would I go about this?
March 18, 2022, 7:17pm
Then every time you generate a block, increase _blocks_left by 1.
March 18, 2022, 7:20pm
Would I create a separate code block for this, or would I add it to the original code you sent?
March 18, 2022, 7:25pm
Also, what would be the best possible way to have all the blocks regenerate in the spots they were originally?
March 18, 2022, 9:07pm
Add it as another action, in same event as where you set regen_block variable to false.
At the start of the scene, go through each obj_block (use a repeat for each object event) and store the co-ordinates in a structure.
Once there are no blocks left in the scene, loop through each element of the structure (use the for each child variable event), creating an obj_block at each stored position
Give it a go, and come back to the forums if you get stuck.
The two events you want are accessed either by clicking tthis icon
in the top right of the editor, or by right clicking on “Add a new event” in the event sheet :