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

#1 2010-06-08 16:36:17

adiguy17
Scratcher
Registered: 2010-05-04
Posts: 17

Putting in Enemies

I my game that I am making, there are going to be enemies. I want the same enemy to show up on different backgrounds. For example, after I defeat the enemy on one background, I want him to come back on another background. I also only want him on backgrounds 1-6. How do I go about doing this?

Offline

 

#2 2010-06-08 20:00:30

DB88
Scratcher
Registered: 2010-05-20
Posts: 42

Re: Putting in Enemies

If you make your enemies sprites, you can <show> or <hide> them on any background you choose.  The scripts you write for the background or the sprites will have to control which enemy/background combinations you show at any given time.


Most Recent Projects: 
Four Bar Linkage Animator:  http://scratch.mit.edu/projects/DB88/1102417  ...... Moon Defender:  http://scratch.mit.edu/projects/DB88/1092234  ..... BUGS:  http://scratch.mit.edu/projects/DB88/1095318

Offline

 

#3 2010-06-09 12:06:52

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Putting in Enemies

CODE FOR ENEMY............

[blocks]
<when green flag clicked>
<forever>
         <if> <( <{  BACKGROUND }> <=> 1 )>
          <show>
         <else>
              <if> <( <{  BACKGROUND }> <=> 2 )>
              <show>
              <else>
              <hide>
              <end>
         <end>
<end>
[/blocks]

CODE FOR STAGE.....................

[blocks]
<when green flag clicked>
<forever>
<set{      BACKGROUND }to( background# [You'll find it in Looks]
<end>
[/blocks]


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

Board footer