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

#1 2009-05-27 20:23:16

matthew115
Scratcher
Registered: 2009-05-27
Posts: 6

how do i create monster to attack and how do i?

how do i attack with swords? and stuff.

Offline

 

#2 2009-05-27 21:01:34

Mike_W
Scratcher
Registered: 2009-02-05
Posts: 100+

Re: how do i create monster to attack and how do i?

I'm not that much of an expert - although I am trying. I would make the sword a seperate sprite from the player - so you can tell if it hits the target as opposed to the player. Remember you can set the center of a sprite off to the side if that helps you group things.

Search for a game called Droid Army, I have not looked at the code much - but I suspect they use that - or a better technique.

Offline

 

#3 2009-05-28 15:13:16

kgordon
Scratcher
Registered: 2009-02-26
Posts: 100+

Re: how do i create monster to attack and how do i?

You could also look at projects such as gods quest or archknights adventure (sorry, I'm to lazy to make the links) with an animation of the character stabbing to see how they did it. I think this is the technique:

For player:

<When[ space ]key pressed><set{ attack }to( 1<repeat( 7<next costume><wait( 0.02 )secsc><switch to costume[ normal<set{ attack }to( 0

For monster:

<when green flag clicked><forever if><touching[ player<if><( <{ attack }> <=> 1 )><hide><stop script><else><change{ player health }by( -10

Offline

 

Board footer