Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » shield blocking
- littlehill24270
- Scratcher
11 posts
shield blocking
hi, im trying to make this game involving a guy with a sword killing enemies. I,m trying to make it so that when he block with his shield and the enemies run into him from the front they bounce off. but i dont know how. how can i do it?
Insanity is doing the same thing, over and over again, but expecting different results.
Albert Einstein
- MegaApuTurkUltra
- Scratcher
1000+ posts
shield blocking
if <touching [shield v]>
glide (1) secs to x:((x position) -(distance to go back)) y: (y position)
$(".box-head")[0].textContent = "committing AT crimes since $whenever"
- MoreGamesNow
- Scratcher
100+ posts
shield blocking
Something like this should work
when gf clicked
set [xv v] to (0)
forever
if<(x position) < ([x position v] of [main character v])>
if<(xv) < (2)>
change [xv v] by (0.2)
end
else
if<(xv) > (-2)>
change [xv v] by (-0.2)
end
end
change x by (xv)
if<touching [shield v]?>
set[xv v] to ((-2) * (xv))
change x by (xv)
Last edited by MoreGamesNow (Sept. 14, 2014 04:12:23)
“Experience: that most brutal of teachers. But you learn, my God do you learn.”
- C.S. Lewis
- littlehill24270
- Scratcher
11 posts
shield blocking
ok, thanks
Insanity is doing the same thing, over and over again, but expecting different results.
Albert Einstein
- Discussion Forums
- » Help with Scripts
- » shield blocking