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

#1 2008-09-20 12:30:51

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Slashing sword?

Im doing a sword game where the sword point towards the mouse.
How do i make it so i hurt the enemy only when slashing the sword?
And How to make it hurts more if i slash it faster?

Last edited by keroro645 (2008-09-20 12:31:40)

Offline

 

#2 2008-09-20 13:47:02

yambanshee
Scratcher
Registered: 2007-11-06
Posts: 500+

Re: Slashing sword?

veriables. Make a verible change another verible or in this case the rate that the sword is moving/rotating at as one verible * the damage verible with other formulas to make it realistic. in my opinion a good example is my drag racers game, the rate of accaleration uses a combination of the engines rpm, the gears and some other stuff that i forgot. Hope that helpd  wink

Offline

 

#3 2008-09-20 13:55:50

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Slashing sword?

I dont understand.
I mean how do i make it so that it tells how fast it rotating?

Offline

 

#4 2008-09-20 16:08:44

keroro645
Scratcher
Registered: 2008-06-07
Posts: 1000+

Re: Slashing sword?

please answer

Offline

 

#5 2008-09-20 16:49:31

SeanCanoodle
Scratcher
Registered: 2008-06-20
Posts: 100+

Re: Slashing sword?

I made a little project for you to use. It's an extremely simple script. Just set it so if the enemy is touching the sword their health is reduced by the slash power.

CLICK!

Offline

 

#6 2008-09-20 17:47:28

deatheater
Scratcher
Registered: 2008-04-11
Posts: 1000+

Re: Slashing sword?

keroro645 wrote:

I dont understand.
I mean how do i make it so that it tells how fast it rotating?

add this script to the sword

<when green flag clicked>
<forever>
<set{ old rotation }to( <direction>
<wait( 0.01 )secsc>
<set{ power }to( <abs( (( <direction> <-> <{ old direction }> ))
<end>

hope that helps  smile

Offline

 

Board footer