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

#1 2011-03-26 06:23:21

DemonScratch
New Scratcher
Registered: 2011-03-26
Posts: 2

How do i change the background when my sprite touches another sprite?

I'm making a game for my school work called Dr. Awesome vs. The Internet (Don't ask why it's called that). The first level is Google and I want it so when Dr. Awesome touches an enemy the background changes. I've got this far:
<when green flag clicked>
<forever if><touching[ Sprite1 ]?
<switch to costume[ AwesomeDead ]
<end>


Please Help!

Offline

 

#2 2011-03-26 06:38:45

Hardmath123
Scratcher
Registered: 2010-02-19
Posts: 1000+

Re: How do i change the background when my sprite touches another sprite?

When Flag Clicked
forever
if touching enemy
set variable [dead] to 1
else
set variable [dead] to 0
end forever

{on stage}
When Flag Clicked
forever
if (dead) = 1
switch to background [dead]
else
switch to background [not dead]  tongue

Hope it helps!


Hardmaths-MacBook-Pro:~ Hardmath$ sudo make $(whoami) a sandwich

Offline

 

#3 2011-03-26 11:06:02

Reverberated3
Scratcher
Registered: 2011-02-24
Posts: 100+

Re: How do i change the background when my sprite touches another sprite?

Or you could use a broadcast script:
When Flag Clicked
repeat until (touching enemy)
(put script here)
End
broadcast (I'm dead)

For the Stage:

When I receive (I'm dead)
switch to costume (dead)


http://i53.tinypic.com/2zs0bah.jpghttp://i51.tinypic.com/30jtrbl.jpg

Offline

 

#4 2011-03-26 12:57:15

Knoxx
Scratcher
Registered: 2011-01-17
Posts: 3

Re: How do i change the background when my sprite touches another sprite?

I think your going to have to broadcast. here are some of the pieces you'll have to use.
<broadcast[  <color[  ]is over[  <when I receive[

Offline

 

#5 2011-04-13 15:41:47

Irvin-D
New Scratcher
Registered: 2011-04-13
Posts: 1

Re: How do i change the background when my sprite touches another sprite?

kkkkkkkkkkkkkkkkkkkkkkkkkkkkk

Offline

 

#6 2011-05-24 16:02:31

thiisisme
Scratcher
Registered: 2011-03-04
Posts: 9

Re: How do i change the background when my sprite touches another sprite?

I Think This should be On SCRATCH. [blocks]http://scratch.mit.edu/forums/viewtopic.php?id=59420#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=59420#req_messagehttp://schttp://scratch.mit.edu/forums/viewtopic.php?id=59420#req_messageratch.mit.edu/forums/viewtopic.php?id=59420#req_messagehttp://scratch.mit.edu/forums/viewtopic.php?id=59420#req_message[/blocks]

Offline

 

#7 2011-05-25 14:31:12

emboar30
Scratcher
Registered: 2011-05-03
Posts: 100+

Re: How do i change the background when my sprite touches another sprite?

Just do what a couple of people have suggested: use the<broadcast[ and <when I receive[ Blocks.          smile   tongue


http://scratch.mit.edu/static/icons/buddy/788987_med.png?t=2011-05-02+15%3A14%3A41
I is epiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiic!     See my stuff here!!!!!

Offline

 

#8 2011-05-25 15:16:36

EzekielE
Scratcher
Registered: 2010-09-26
Posts: 100+

Re: How do i change the background when my sprite touches another sprite?

Sprite


<when green flag clicked>


<forever if>    <touching[ enemy


<broadcast[ touching enemy


<wait until>    <<  <not>     <touching[ enemy >>


<end>


Stage


<when I receive[ touching enemy


<next costume>

Last edited by EzekielE (2011-05-25 15:16:59)


http://mag.racked.eu/cimage/i2260/Achievement++get%21/Find+a+Disk/mca.pnghttp://ezekielelin.com/1x1Gif/image.php

Offline

 

Board footer