hey, I was wondering how you make it to change background when you walk onto a certain are (ex. walking into a door on pokemon) if anyone could help that woulld be nice.
Offline
Hi,
Basically, you just have either a variable that controls the "level" or "stage" or whatever, or you can use broadcasting, like this:
To put in your character:
When gf clicked If < touching? [door v]> Broadcast [next BG v] EndTo put in the stage:
When I receive [next BG v] next backgroundHope that helps,
Last edited by CAA14 (2013-04-12 00:51:53)
Offline
I'm kinda new to this scratch program so if you could give me a little tutorial on how to do this because I am making a game when in that game I want the character to walk through a door to the next room. So if you could give me a noob-tutorial on that it would be nice.
Offline
Make a sprite called door. Make your background look like the inside of a house or wherever you want it to be, but have a hole in the wall that is the same size and shape as the door. Drag the door so that it is perfectly inline with the hole and leave it there. Go into motion and click on the checkboxs by x position and y position. Make a note of both. Make a new background that is outside the house, with ahother hole in the wall of the house, the same size. Move the door to that hole and make a note of the x pos and y pos. Make a character and use the if key [ (up arrow / left arrow e.t.c. v] pressed change x or y by 2 or -2 so that the chracter moves with the arrow keys. Put these all in a forever, connected to a when gf clicked. On the door put when gf clicked,forever: go to x(the first x pos you noted) y(the first y pos), wait until touching character, broadcast [next v], go to x(second x) y(second y), wait until not touching charcter, wait until touching character, broadcast [back v].
On the background put when gf clicked switch to background background 1. When I recieve next, next background. When I recieve back, switch to background ((background #) -(1)). Finally in the character put when I recieve next, go to x(second x) y(secon y). When I recieve back, goto x(first x) y( first y). If you don't understand any of that, I'll make a sample project for you.
Offline
When I go to looks there is no new background though
Offline
To make a new background you go to stage (near where all the sprites are) and go to backgrounds (near the top) in the bar that has scripts and sounds. You should now see a white background. Click on edit to change this. Alternatively, you can paint, import or take a picture to make a totally new background.
Offline