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

#1 2012-04-04 17:12:16

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

help with attacking

when you attack while walking you dont complete the whole attack I know why this is happening but i dont know how to fix it.
here is the link
http://scratch.mit.edu/projects/ftf841/2413414

Last edited by ftf841 (2012-04-04 17:13:50)


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

#2 2012-04-04 20:03:14

SOScratch
Scratcher
Registered: 2010-02-01
Posts: 100+

Re: help with attacking

Oh, I see your problem.
The script for the animation for the Kirby Sprite is overtaking the script for when you attack.

To make it clear,
when you are walking, there is a script to make Kirby animate and move.
When you attack, the script for moving is still going and so the attacking animation gets overlapped.

A possible fix would be to, in the walking script, add something like:


when green flag clicked
forever if << key [left arrow v] pressed?> or <key [right arrow v] pressed?> or <key [up arrow v] pressed?> or <key [down arrow v] pressed?> and <not <key [z v] pressed>


And then from there, add your script for moving kirby. And keep all your other scripts.
That should fix the problem. If not, just ask.

Last edited by SOScratch (2012-04-04 20:03:39)


-SOScratch
Scratch On!

Offline

 

#3 2012-04-05 11:49:54

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

Re: help with attacking

nope


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

#4 2012-04-05 12:08:21

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: help with attacking

To fix this you could have a variable "attacking" and them have:

when gf clicked
forever
   if (<attacking> <1) and (<movement key> pressed)
      animation


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#5 2012-04-05 12:25:18

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

Re: help with attacking

zammer990 wrote:

To fix this you could have a variable "attacking" and them have:

when gf clicked
forever
   if <<<attacking> < [1]> and <[movement v]key> pressed>>
      animation

that didn't help

Last edited by ftf841 (2012-04-07 17:28:40)


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

#6 2012-04-05 12:33:17

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: help with attacking

I just looked at your code and I found 2 things: !) it's got loads of redundancies in for example the movement script double detects
2)I can't even comprehend half of it, the variables aren't clear and if you want someone to fix something it's better if they are

When I played your project I didn't find anything wrong anyway...


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#7 2012-04-05 13:14:22

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

Re: help with attacking

zammer990 wrote:

I just looked at your code and I found 2 things: !) it's got loads of redundancies in for example the movement script double detects
2)I can't even comprehend half of it, the variables aren't clear and if you want someone to fix something it's better if they are

When I played your project I didn't find anything wrong anyway...

when you played the game did you play adventure mode or vs because vs mode works completely fine


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

#8 2012-04-06 13:00:29

zammer990
Scratcher
Registered: 2012-01-22
Posts: 500+

Re: help with attacking

Adventure


http://i45.tinypic.com/2ynq7nn.jpg Play now!

Offline

 

#9 2012-04-06 16:23:35

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

Re: help with attacking

what are the variables that you dont understand and i can define them for you


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

#10 2012-04-09 10:17:31

ftf841
Scratcher
Registered: 2012-02-19
Posts: 1000+

Re: help with attacking

bump


http://mag.racked.eu/cimage/i9002/Achievement++get%21/Hi+there./mca.png
http://mag.racked.eu/mcimage/i354/Achievement++get%21/CAKE%21%21%21%21%21/mca.png

Offline

 

Board footer