Discuss Scratch

fmm26
New Scratcher
1 post

how to make a proper randomizer for attack pattern?

hello i really need help for making a new attack pattern for a boss fight (touhou), i tried using randomizer from youtube / making my own but it didnt work properly, the common problem was my script and broadcast executed more than once even though i tried using variable and <if block>, the code always executed like 100x more than it should be making my attack look horrible

repeat until <(repeatTurn) < [1]>
broadcast [movement v]
broadcast [attack1 v] and wait
set [randomPattern v] to (pick random (1) to (3))
broadcast [randomizer v]
wait until <(attackDone) = [1]>
end

i think this is the problem, bc when i tried to use only broadcast movement and broadcast attack everything works properly, is there any suggestion? if you need more context i will send my project
DarkMB
Scratcher
26 posts

how to make a proper randomizer for attack pattern?

I would love to help, please send the project though, as the problem could also be in the receiving bit of the broadcasts. Thanks!
JEMA2311
Scratcher
73 posts

how to make a proper randomizer for attack pattern?

I agree we may need to see the project to better undertstand the context of the script. However. If what you wrote is exactly the code you used, maybe using “broadcast and wait” on the randomizer message could help.

I´m just guessing though.

Powered by DjangoBB