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

#1 2012-12-23 19:44:47

KateblurTheHedgehog
Scratcher
Registered: 2012-12-13
Posts: 18

Help with spindash.

I want to put spindash in my new Greenson game, but it's not working.


when gf clicked

forever if <<key [down arrow v] pressed?> and <key [s v] pressed?>>  

set [Spindash v] to [1]

switch to costume [Spindash v]

end


when gf clicked

forever  

if <not <<key [down arrow v] pressed?> and <<not <key [s v] pressed?>> and <(Spindash) = [1]>>>> 

move (50) steps

set [Spindash v] to [0]

end

end

Heelp!


My computer explodes : It's a tragedy. Your computer exploded : sarcastic comedy.Hmph enjoy your computer exloding I got an notebook with 2 Ghz...

Offline

 

#2 2012-12-24 08:25:42

BetaSmozzick
Scratcher
Registered: 2012-02-25
Posts: 51

Re: Help with spindash.

I'm not sure if this is just because the forum squashed your code but it looks like you have:

if <not <(key [down arrow v] pressed?) and <<not (key [s v] pressed?)> and <(spindash) = [1]>>>>
which would be bad I think...one moment.

Why it doesn't work

At the moment you are checking for when the down arrow is pressed and key s isn't pressed and spindash = 1. Notted. So what you are actually checking for is when that statement is false.

How to fix

Just removing that first not would make it work most of the time, I think.


---



Overall something like this might work better:


when gf clicked
forever
if <<not (key [s v] pressed?)> and <(spindash) = [1]>>
move [50] steps
set [spindash v] to [0]
switch to costume [standing v]
or crouching costume, maybe do an if else for that
else
if (key [down arrow v] pressed?)
switch to costume [crouch v]
if (key [s v] pressed?)
set [spindash v] to [1]
switch to costume [spindash v]
end
else
rest of movement code
end

end

Last edited by BetaSmozzick (2012-12-24 08:35:38)

Offline

 

#3 2012-12-24 09:48:05

KateblurTheHedgehog
Scratcher
Registered: 2012-12-13
Posts: 18

Re: Help with spindash.

I will test.
Thanks!
*kiss*

when gf clicked
Scratch on!


My computer explodes : It's a tragedy. Your computer exploded : sarcastic comedy.Hmph enjoy your computer exloding I got an notebook with 2 Ghz...

Offline

 

#4 2012-12-24 10:02:51

KateblurTheHedgehog
Scratcher
Registered: 2012-12-13
Posts: 18

Re: Help with spindash.

Hey, wait, it's not working
greenson moves when i press the two keys at the same time,
and he don't move when i realese down but not s.


My computer explodes : It's a tragedy. Your computer exploded : sarcastic comedy.Hmph enjoy your computer exloding I got an notebook with 2 Ghz...

Offline

 

#5 2012-12-24 10:05:33

rlojunior
Scratcher
Registered: 2010-08-11
Posts: 59

Re: Help with spindash.

KateblurTheHedgehog wrote:

Hey, wait, it's not working
greenson moves when i press the two keys at the same time,
and he don't move when i realese down but not s.

See this post http://scratch.mit.edu/forums/viewtopic.php?id=111900
On portuguese forum.
I guess it can helps you.

Last edited by rlojunior (2012-12-24 10:07:16)

Offline

 

Board footer