So, I’m making this game, and in it, you block the boss’s attacks before hitting him.
I’m currently Scratching my head (pun intended) as to why hitting the boss does nothing.
I’d provide further information, but Imma wait until y’all ask questions to provide answers.
Here’s the link: Bugged game
Use Q to hit and E to block
Since you said “Scratching” I’ll weigh in with some comments.
Your “Attack?” variable is set by the “when Q key pressed” but it is never used by the boss script.
You could probably have the boss script look for Attack=1 but then you’d want the boss script to reset it to 0 instead of the hands sprite so there is no chance for the boss script to miss it.
Hands broadcasts a message to Boss when Hands are in the right place at the right time using the variable, so exactly how does “Boss never uses the variable” become a problem?
oh. I think its the timing of the events and because the “when” block is not reentrant so the lining up of the attack? variable value and the boss stun variable value is not likely to happen because the “When” script has a wait block. The “When” event blocks are not that useful on Scratch and I almost never use them.
You can see the problem with the when blocks by trying to increase the counter value in this code. You might think you could increase ‘counter’ by going back and forth with the space key and the up arrow key but that’s not how the developer wanted it to work.
Same problem on Scratch.
The [wait until __] block?
Yes, also the wait until block. You won’t see this explained in the help pop-up but the when script will not run again until the previous execution is completed.
Another case study to try: (be sure to watch the value of “counter” as you press space and up arrow several times.)
Pressing the space once makes the counter increase once, then waits until the code finishes.
Reentering space doesn’t do anything until the wait is over, and keeping it true also does nothing when the wait is over.
Same here
I HAVE FOUND THE PROBLEM!
I had a <not > block that (for some reason) stopped attacks from attacking.
Welp, case closed!