This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-12-12 10:46:23

moose12141
Scratcher
Registered: 2008-04-03
Posts: 57

Help with RPG fight

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

 

#2 2010-12-12 11:12:36

Thenuclearduck
Scratcher
Registered: 2010-10-17
Posts: 100+

Re: Help with RPG fight

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!


http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=text&amp;num=1 is my newest project! It has http://blocks.scratchr.org/API.php?user=Thenuclearduck&amp;action=projects&amp;type=newest&amp;return=views&amp;num=1 views!

Offline

 

#3 2010-12-12 13:47:39

moose12141
Scratcher
Registered: 2008-04-03
Posts: 57

Re: Help with RPG fight

I get the idea, but I'm having trouble implementing it. There's just so much other stuff going on.

Offline

 

Board footer