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

#1 2007-08-24 14:12:57

jophish126
Scratcher
Registered: 2007-08-22
Posts: 10

AUGHH!!!!! Question!

Hi, im wondering how youd make a solid, unpassable sprite,  not background, sprite, thank you much!

Offline

 

#2 2007-08-24 14:27:02

Sawman3
Scratcher
Registered: 2007-07-19
Posts: 97

Re: AUGHH!!!!! Question!

There's no way to simply paint a sprite so that it is solid, or even effectively code for it within that sprite.  But what can do is for all the sprite's that you want not to be able to move through the unpassable one, create code that looks something like this:
(just and example)
<when[ right arrow ]key pressed>
<repeat until> [touching (unpassable sprite]
<move( 5 )steps>

or you could just add modifiers to all movement blocks that look like this:
(just and example)
<if>[touching (unpassable sprite]
<stop script>

Hope that helped!


"These are the old days, the glory days...they're back."

Offline

 

#3 2007-08-24 14:28:20

Sawman3
Scratcher
Registered: 2007-07-19
Posts: 97

Re: AUGHH!!!!! Question!

sry, I meant just AN example, not AND  tongue


"These are the old days, the glory days...they're back."

Offline

 

#4 2007-08-24 14:31:09

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: AUGHH!!!!! Question!

[blocks]
  <touching[
[/blocks]

use this on any sprites that might come in contact with the sprite you want to be solid, then move them away or whatever you want...that help, dunno if i answered the question, but i think that's what you're asking

Last edited by soccrplyer4life13 (2007-08-24 14:31:46)


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#5 2007-08-24 14:32:39

Sawman3
Scratcher
Registered: 2007-07-19
Posts: 97

Re: AUGHH!!!!! Question!

Thanks soccrplyer4life13 that's the block I forgot to add in my post--I just typed it.  Now he can see what it actually is  big_smile


"These are the old days, the glory days...they're back."

Offline

 

#6 2007-08-24 14:47:42

jophish126
Scratcher
Registered: 2007-08-22
Posts: 10

Re: AUGHH!!!!! Question!

THanks for all the help!

Offline

 

#7 2007-08-24 14:48:46

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: AUGHH!!!!! Question!

no problem


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#8 2007-08-24 14:58:20

jophish126
Scratcher
Registered: 2007-08-22
Posts: 10

Re: AUGHH!!!!! Question!

i put in ablock like that and it isnt working

Offline

 

#9 2007-08-24 15:02:41

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: AUGHH!!!!! Question!

[blocks]
<if>
[/blocks]

the  <touching[
block has to have some form of control around it, like an if statement or a repeat until statement.  If you link to the project you're working on, maybe we can help you further by giving an example using your own code.

Last edited by soccrplyer4life13 (2007-08-24 15:04:20)


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#10 2007-08-24 15:04:32

Sawman3
Scratcher
Registered: 2007-07-19
Posts: 97

Re: AUGHH!!!!! Question!

Yes, a link would help greatly.  Also, remember you have to link the touching block to another with a diamond shaped portal for it (just in case you forgot)  wink


"These are the old days, the glory days...they're back."

Offline

 

#11 2007-08-24 15:06:08

Sawman3
Scratcher
Registered: 2007-07-19
Posts: 97

Re: AUGHH!!!!! Question!

Wait that's what soccrplayer4life13 just said--my bad.


"These are the old days, the glory days...they're back."

Offline

 

#12 2007-08-24 15:08:05

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: AUGHH!!!!! Question!

lol, i'm still struggling with these code blocks, they're an awesome feature, i'm just picky on my ease of use...


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#13 2007-08-24 15:24:55

jophish126
Scratcher
Registered: 2007-08-22
Posts: 10

Re: AUGHH!!!!! Question!

Ok, but its a complete test, im trying to  make  it so when i deafet enemys i broadcast and make the wall dissapear

Offline

 

#14 2007-08-24 15:27:01

jophish126
Scratcher
Registered: 2007-08-22
Posts: 10

Re: AUGHH!!!!! Question!

Heres the libk, but remember, its JUST A TEST. http://scratch.mit.edu/projects/jophish126/31557

Offline

 

#15 2007-08-24 15:29:32

jophish126
Scratcher
Registered: 2007-08-22
Posts: 10

Re: AUGHH!!!!! Question!

Nad the RED BOX is the suppousedly unpasable  sprite

Offline

 

#16 2007-08-24 15:52:48

soccrplyer4life13
Scratcher
Registered: 2007-07-28
Posts: 77

Re: AUGHH!!!!! Question!

[blocks]
<when[ left arrow ]key pressed>
<if><<  <not><touching[ Sprite3  >>
<point in direction( -90
<move( 10 )steps>

[/blocks]

That should do it, let me know. Put that in all of your arrow scripts for the main sprite.

Last edited by soccrplyer4life13 (2007-08-24 15:55:53)


My Projects:
http://scratch.mit.edu/users/soccrplyer4life13

Offline

 

#17 2007-08-24 18:27:55

jophish126
Scratcher
Registered: 2007-08-22
Posts: 10

Re: AUGHH!!!!! Question!

Well, huh when i touch , i cant move  in  ANY direction

Offline

 

#18 2007-08-28 12:30:46

Jacobo
Scratcher
Registered: 2007-06-15
Posts: 100+

Re: AUGHH!!!!! Question!

this is what I would do: (see link)
http://scratch.mit.edu/projects/Jacobo/32541

Last edited by Jacobo (2007-08-28 12:35:14)


"It's like deja vu all over again"
-Yogi Berra

Offline

 

#19 2007-08-28 14:00:17

Llamalover
Scratcher
Registered: 2007-05-18
Posts: 100+

Re: AUGHH!!!!! Question!

Simple, all you have to do is [blocks]
<when green flag clicked>
<stamp>
[/blocks]
Then for the other sprites (by the way, let's say that your unpassable sprite is black)
[blocks]
<when green flag clicked>
<forever>
<repeat until><touching color[ black]
<move( 2 )steps>
<end>
<end>
[/blocks]
That's about it, there's more you might want me to explain, if you do, just say!


Be nice, I'm an old lady  wink

Offline

 

#20 2007-08-28 23:12:45

archmage
Scratcher
Registered: 2007-05-18
Posts: 1000+

Re: AUGHH!!!!! Question!

This will work best if your player sprite is moved using the direction and move blocks

<when green flag clicked>
<forever if><touching[ Wall sprite]
<move( -1 )steps>

This will make the sprite I have named "wall sprite" impassible  smile


Hi, I am Archmage coder extraordinaire. I do Scratch,pascal,java,php,html, AS2 and AS3. Leave me a message if you want coding advice. Also check out my personal website, lots of good stuff about web development, Flash, and Scratch (v1 and v2) !

Offline

 

#21 2007-08-29 06:50:25

Jacobo
Scratcher
Registered: 2007-06-15
Posts: 100+

Re: AUGHH!!!!! Question!

Archmage is correct.


"It's like deja vu all over again"
-Yogi Berra

Offline

 

Board footer