Discuss Scratch

MinecraftParty77
Scratcher
100+ posts

Now son, Dont go through that wall.

Hey guys. So im working on a game based of a game on Nintendo Land for Wii U, and, well, my characters can go right through the walls. I dont know how to stop this from happening. Can anyone help me with this?
Major thanks
~MinecraftParty77

Zombies: Remastered

A Brand New Survival game, based off the original game ZOMBIES and ZOMBIES II: TNT Apocalypse.

Play it when it's available!
scimonster
Scratcher
1000+ posts

Now son, Dont go through that wall.

Try sensing when you're touching a wall with the <touching color ?> block. Then, if you are, go backwards to bounce off.

Retired Community Moderator
BTW, i run Google Chrome 41.0.2272.101 on a Linux system - Ubuntu 14.04. NEW: iPad 4th gen. w/retina.

418 I'm a teapot (original - to be read by bored computer geeks)
THE GAME (you just lost)
; THE SEMICOLON LIVES ON IN OUR SIGS
CrazyNimbus
Scratcher
500+ posts

Now son, Dont go through that wall.

You can say if on edge, bounce, or if touching (Some Wall) Then glide to x(-?), y(-?). Hope that helps!

Meow! This post has been approved by nine adorable little cats!
<< Scratch Rewind 2017 Scratch Design Studio! https://scratch.mit.edu/studios/4607452/ <<
MinecraftParty77
Scratcher
100+ posts

Now son, Dont go through that wall.

scimonster wrote:

Try sensing when you're touching a wall with the <touching color ?> block. Then, if you are, go backwards to bounce off.

CrazyNimbus wrote:

You can say if on edge, bounce, or if touching (Some Wall) Then glide to x(-?), y(-?). Hope that helps!

What I'm trying to do is to not have the characters go through “ANY” of the walls! Otherwise those would work.

Last edited by MinecraftParty77 (July 5, 2013 03:38:15)


Zombies: Remastered

A Brand New Survival game, based off the original game ZOMBIES and ZOMBIES II: TNT Apocalypse.

Play it when it's available!
drmcw
Scratcher
1000+ posts

Now son, Dont go through that wall.

MinecraftParty77 wrote:

scimonster wrote:

Try sensing when you're touching a wall with the <touching color ?> block. Then, if you are, go backwards to bounce off.

CrazyNimbus wrote:

You can say if on edge, bounce, or if touching (Some Wall) Then glide to x(-?), y(-?). Hope that helps!

What I'm trying to do is to not have the characters go through “ANY” of the walls! Otherwise those would work.

If the walls aren't a colour or a sprite then you'll need to say what they are.

10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
superstikfa
Scratcher
100+ posts

Now son, Dont go through that wall.

Could you show me what the scripts are so far? Posting what you have so far as a demo might be helpful.

MinecraftParty77
Scratcher
100+ posts

Now son, Dont go through that wall.

superstikfa wrote:

Could you show me what the scripts are so far? Posting what you have so far as a demo might be helpful.

Ill take a snapshot and post it.

Zombies: Remastered

A Brand New Survival game, based off the original game ZOMBIES and ZOMBIES II: TNT Apocalypse.

Play it when it's available!
Cookiemonster4
Scratcher
10 posts

Now son, Dont go through that wall.

Well sensing blocks would help, like if the walls are lets say, green, you add if touching colour green then……….Whatever you want to happen!
MinecraftParty77
Scratcher
100+ posts

Now son, Dont go through that wall.

Cookiemonster4 wrote:

Well sensing blocks would help, like if the walls are lets say, green, you add if touching colour green then……….Whatever you want to happen!
I tried doing that, then the “whatever I wanted to happen” thing was turn 180 degrees -> But it just got really messed up and glitchy

Zombies: Remastered

A Brand New Survival game, based off the original game ZOMBIES and ZOMBIES II: TNT Apocalypse.

Play it when it's available!
dvd4
Scratcher
100+ posts

Now son, Dont go through that wall.

MinecraftParty77 wrote:

Cookiemonster4 wrote:

Well sensing blocks would help, like if the walls are lets say, green, you add if touching colour green then……….Whatever you want to happen!
I tried doing that, then the “whatever I wanted to happen” thing was turn 180 degrees -> But it just got really messed up and glitchy
y'mean spinning in circles ?

The title…IT SO FUNNY LOLOLOLOL :P


YOU WILL REMEMBER MY NAME
drmcw
Scratcher
1000+ posts

Now son, Dont go through that wall.

So the walls are a colour! Assuming you are using move rather than changing x and y then have you tried something like;

if touching wall colour
repeat until not touching wall colour
move -1


Also have you looked at the sticky topics as they have lots of examples like this.

Last edited by drmcw (July 17, 2013 08:42:35)


10 !
ScratchVaders or Galaga?
Maybe Eliza can help you decide?
cookiegr
Scratcher
100+ posts

Now son, Dont go through that wall.

I had the exact problem a while ago.
Here's what I did to fix it:
If touching <color of wall>
point in direction <opposite of the one sprite is going in>
change x or y by <opposite of your current direction>

The above one is a bit complicated to explain however, so you could just use:

If touching <color or wall>
move -10 steps

epicman509
Scratcher
24 posts

Now son, Dont go through that wall.

I usually use the color sensing block. 'When green flag clicked- forever(if touching color ___) then- repeat until <not> touching color ___- point in direction -90(left)- move 1 step. If you are heading the other way(left to right), point in direction 90(right).
Stravant
New to Scratch
9 posts

Now son, Dont go through that wall.

When flag clicked
Forever
If <Touching color (color of your wall here> Then
Move -10 steps



Apply this to all your walls you don't want to be walkthroughable and you'll do fine!
Walrus227
Scratcher
54 posts

Now son, Dont go through that wall.

MinecraftParty77 wrote:

Cookiemonster4 wrote:

Well sensing blocks would help, like if the walls are lets say, green, you add if touching colour green then……….Whatever you want to happen!
I tried doing that, then the “whatever I wanted to happen” thing was turn 180 degrees -> But it just got really messed up and glitchy
Yeah, you have to make an upside-down costume, too. This link leads to an awkward example.
ComputerCrazy
Scratcher
41 posts

Now son, Dont go through that wall.

<if touching> block color. <then change x by 5>


MinecraftParty77
Scratcher
100+ posts

Now son, Dont go through that wall.

drmcw wrote:

So the walls are a colour! Assuming you are using move rather than changing x and y then have you tried something like;

if touching wall colour
repeat until not touching wall colour
move -1


Also have you looked at the sticky topics as they have lots of examples like this.

No what I did was

if touching <color >
turn (-> 180) degrees
move 2 steps

Zombies: Remastered

A Brand New Survival game, based off the original game ZOMBIES and ZOMBIES II: TNT Apocalypse.

Play it when it's available!
MinecraftParty77
Scratcher
100+ posts

Now son, Dont go through that wall.

Stravant wrote:

When flag clicked
Forever
If <Touching color (color of your wall here> Then
Move -10 steps



Apply this to all your walls you don't want to be walkthroughable and you'll do fine!

There are a bunch of walls

Zombies: Remastered

A Brand New Survival game, based off the original game ZOMBIES and ZOMBIES II: TNT Apocalypse.

Play it when it's available!

Powered by DjangoBB

Standard | Mobile