Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Moving background help
- Zarlog
-
100+ posts
Moving background help
https://scratch.mit.edu/projects/113400648/
In this project I want the character to be able to go anywhere in the house. I do NOT want them to be able to go outside the house. Any idea how I can make it so it stops when they reach a wall?
In this project I want the character to be able to go anywhere in the house. I do NOT want them to be able to go outside the house. Any idea how I can make it so it stops when they reach a wall?
- mstone326
-
1000+ posts
Moving background help
I created a duplicate sprite of your house that moves around. I named it, “what giga interacts with”. You'll see in the example I created transparent areas that he was able to walk (use solid rectangle tool then fill with transparent or just use eraser).
For example, when you press the right arrow, the screen changes X by 8 but inside that if I added another test, if touching Giga change X by -8. That will stop your player from moving.
In the remix I have Giga interacting with the back layer but the users see the top layer. I only created 3 or 4 walkable areas in the house just to show for example. He'll walk on transparent, and stop on solid. yet the user never sees the back layer (what Giga interacts with) and all the user sees is the top layer (what the user sees).
https://scratch.mit.edu/projects/118283994/
For example, when you press the right arrow, the screen changes X by 8 but inside that if I added another test, if touching Giga change X by -8. That will stop your player from moving.
In the remix I have Giga interacting with the back layer but the users see the top layer. I only created 3 or 4 walkable areas in the house just to show for example. He'll walk on transparent, and stop on solid. yet the user never sees the back layer (what Giga interacts with) and all the user sees is the top layer (what the user sees).
https://scratch.mit.edu/projects/118283994/
Last edited by mstone326 (Aug. 14, 2016 01:26:34)
- Zarlog
-
100+ posts
Moving background help
Thanks. How would I make “doors” you can walk through (maybe that is a bit too advanced) I created a duplicate sprite of your house that moves around. I named it, “what giga interacts with”. You'll see in the example I created transparent areas that he was able to walk (use solid rectangle tool then fill with transparent or just use eraser).
For example, when you press the right arrow, the screen changes X by 8 but inside that if I added another test, if touching Giga change X by -8. That will stop your player from moving.
In the remix I have Giga interacting with the back layer but the users see the top layer. I only created 3 or 4 walkable areas in the house just to show for example. He'll walk on transparent, and stop on solid. yet the user never sees the back layer (what Giga interacts with) and all the user sees is the top layer (what the user sees).
https://scratch.mit.edu/projects/118283994/
- mstone326
-
1000+ posts
Moving background help
Not too advanced. How would the doors work? Need a key? A password? Just walk into them and you can pass?
- Zarlog
-
100+ posts
Moving background help
Just walk through them without a password or anything. Not too advanced. How would the doors work? Need a key? A password? Just walk into them and you can pass?
- mstone326
-
1000+ posts
Moving background help
How do you want the door to pass or whatnot? If you look at the example I showed you'll see how I created passages by making them transparent. Whatever is transparent your person can pass through. Not sure if that is what you meant by “doors” or if you want a door that appears then when you touch disappears and then you can pass through and then reappears.
Not sure what you exactly mean. Let me know.
Not sure what you exactly mean. Let me know.
- FlubbaFish
-
62 posts
Moving background help
I made one that that makes it so that giga can't go outside of the area.
You can edit it if you like.
This is the link to it, Click me!
I have put a effort into this so if you don't mind please check out my chicken caring simulator, link below.
Thank you, FlubbaFish.
You can edit it if you like.
This is the link to it, Click me!
I have put a effort into this so if you don't mind please check out my chicken caring simulator, link below.
Thank you, FlubbaFish.
- Discussion Forums
- » Help with Scripts
-
» Moving background help