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

#1 2009-08-22 03:33:32

benistar
Scratcher
Registered: 2009-08-17
Posts: 2

2 questions

how do u make so when ur sprite gets to edge its go to a different background???, instead of using scrollx, im making a game and i need some help with it as well

how do u make the game stop when u make ur health reach 0???

Offline

 

#2 2009-08-23 00:17:08

shadow_7283
Scratcher
Registered: 2007-11-07
Posts: 1000+

Re: 2 questions

Your health request is simple enough. Just use a variable named "health" and use a script like this:
<when green flag clicked>
<forever>
<if><(<{health }>  <<> 1 )>
<stop all>
<end>

I am not sure about your background request. Do you want a scrolling background that only scrolls when something is near the edge, or do you just want the background to change?

Offline

 

#3 2009-08-23 13:11:52

-db-
Scratcher
Registered: 2009-06-04
Posts: 100+

Re: 2 questions

i think this is the answer you're looking for. take a look at the project, and download to see the scripts.
http://scratch.mit.edu/projects/Paddle2SeeFixIt/646808


http://i31.tinypic.com/2n8ofg4.jpg

Offline

 

#4 2009-08-23 18:04:20

coolperson
Scratcher
Registered: 2007-08-21
Posts: 1000+

Re: 2 questions

Yeah, -db-'s advice is good. Follow it!


Coolperson- 2012 National Vex Robotics Finalist!
http://www.scratch.mit.edu/ext/youtube/?v=sn7p84DQFyk

Offline

 

#5 2009-08-23 18:48:06

-db-
Scratcher
Registered: 2009-06-04
Posts: 100+

Re: 2 questions

in that project, you can only change background if you touch the edges on the left or right side. I'm not sure if you want it like that, or just the top and bottom edges, or all the sides, but i think the programming is almost the same whichever way you want it.


http://i31.tinypic.com/2n8ofg4.jpg

Offline

 

Board footer