Hi, im wondering how youd make a solid, unpassable sprite, not background, sprite, thank you much!
Offline
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!
Offline
[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)
Offline
THanks for all the help!
Offline
no problem
Offline
i put in ablock like that and it isnt working
Offline
[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)
Offline
lol, i'm still struggling with these code blocks, they're an awesome feature, i'm just picky on my ease of use...
Offline
Ok, but its a complete test, im trying to make it so when i deafet enemys i broadcast and make the wall dissapear
Offline
Heres the libk, but remember, its JUST A TEST. http://scratch.mit.edu/projects/jophish126/31557
Offline
Nad the RED BOX is the suppousedly unpasable sprite
Offline
[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)
Offline
Well, huh when i touch , i cant move in ANY direction
Offline
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!
Offline
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
Offline