Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Sprites and Solid Furniture
- SnakeVenomous
-
7 posts
Sprites and Solid Furniture
I made a sprite that you can move around in his room. I put all the furniture and put it in one image and used something similar to this script to make the furniture solid/not make the sprite go through it.
Here's the image of the room I put together: http://imgur.com/hBs5Djb (used opengameart.org
)
But when I tested this, I found that the sprite could move backwards through the furniture so that didin't work.
After some testing with scripts I decided to make the furniture different sprites. I took the floor out and made that the background and for testing purposes, I inserted a red rectangle. I first used this project's method: http://scratch.mit.edu/projects/188807/ but it made the sprite stuck inside the square and I couldn't get him out by using WASD. Then I used the method that's in my project right now and that made the sprite rotate and move forwards and backwards constantly.
Can anyone find a way to make a sprite/furniture solid?
Link to my project: http://scratch.mit.edu/projects/15574026/
My browser / operating system: Ubuntu Linux, Firefox 30.0, Flash 11.2 (release 202)
Here's the image of the room I put together: http://imgur.com/hBs5Djb (used opengameart.org

But when I tested this, I found that the sprite could move backwards through the furniture so that didin't work.
After some testing with scripts I decided to make the furniture different sprites. I took the floor out and made that the background and for testing purposes, I inserted a red rectangle. I first used this project's method: http://scratch.mit.edu/projects/188807/ but it made the sprite stuck inside the square and I couldn't get him out by using WASD. Then I used the method that's in my project right now and that made the sprite rotate and move forwards and backwards constantly.
Can anyone find a way to make a sprite/furniture solid?
Link to my project: http://scratch.mit.edu/projects/15574026/
My browser / operating system: Ubuntu Linux, Firefox 30.0, Flash 11.2 (release 202)
- 110Percent
-
100+ posts
Sprites and Solid Furniture
Instead of using this script:

Use THIS script:
If you had used x and y velocity scripts, I could've given you a better script, but this is all I can offer.

- SnakeVenomous
-
7 posts
Sprites and Solid Furniture
Well, I already used that script and it did not work well for the RPG. It might work well in a platformer but I can make my character move through the furniture by turning him around. I messed around with some velocity scripts but I couldn't get it to work perfectly and also velocity is ned really good in an rpg. Is there anything else I can do?
- ryandw
-
62 posts
Sprites and Solid Furniture
you could do this:
This is one way. I tested it and it work.
- Theprodigy
-
100+ posts
Sprites and Solid Furniture
I made this: http://scratch.mit.edu/projects/24583586/, it has the collision system, all you would need to do is change the shape of the wall for every new area to match the objects that you want to collide with.
- orangegirl88
-
11 posts
Sprites and Solid Furniture
This sound really silly, but can someone tell me how to post a question in discussions? I'd appreciate it!

- Theprodigy
-
100+ posts
Sprites and Solid Furniture
Click the new topic button, under ‘help with scripts’, or any other section of the forum that you want the question to be in.
- SnakeVenomous
-
7 posts
Sprites and Solid Furniture
Very sorry for the late response but I'm sure to implement this into my project. Thank you! Also, if you go into another room, is there a way to hide/remove them if not in the area?
- Theprodigy
-
100+ posts
Sprites and Solid Furniture
Yes, add different costumes. Next, in each costume change the shape of the “wall” sprite to fit whatever objects you have in the new area.
Last edited by Theprodigy (July 21, 2014 15:12:40)
- Discussion Forums
- » Help with Scripts
-
» Sprites and Solid Furniture