I'm making an RPG, but I can't figure out how to make a turn-based fight. Also, the enemy doesn't always die when his hp reaches or goes below zero. Here's the game: http://scratch.mit.edu/projects/moose12141/1471057
Offline
you'd have to make it so that when the character attacks, he can broadcast a message enabling the other character to fight. Say the script starts on character1. You would do it like this.
On character1:
When flag clicked:
set attack1(variable) to 1
Forever if attack1 =1
If attack key pressed
switch to costume attack
set attack2 to 1
switch to costume normal
And on the second character:
When flag clicked:
set attack2(variable) to 1
Forever if attack2 =1
If attack key pressed
switch to costume attack
set attack1 to 1
switch to costume normal
This will make it so that only one character can attack at a time, and will alternate it.
Ans with your below zero problem, you just need to make a script on both of the characters that goes like this:
When flag clicked
Forever if sprite1/sprite2 hp < 0
Broadcast die1/die2.
Hope I helped, and I would love to see your project finished!
Offline
I get the idea, but I'm having trouble implementing it. There's just so much other stuff going on.
Offline