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

#1 2013-01-21 19:28:31

Zebus
New Scratcher
Registered: 2013-01-21
Posts: 14

Help with Enemys

So I am trying to have enemys scroll down from the top of the screen and then disapper at the bottom

so right now all i have is a if else function that i have no clue if it would even work\

if y >= 180 <-----not sure what function to put right here
go to x pick random -200 to 200 y=187

else
change y by -10

Offline

 

#2 2013-01-21 20:57:17

AgentCNF
Scratcher
Registered: 2012-08-27
Posts: 21

Re: Help with Enemys

Hmmm..... I don't know EXACTLY what you mean.... But try this.

when gf clicked
repeat until <touching [edge v]?>
 change y by [-5]
end 
That will make your sprite keep going down until he is touching the bottom edge

Last edited by AgentCNF (2013-01-21 21:00:09)


Go St. Louis Cardinals!!! I Hate The Cubs!

Offline

 

#3 2013-01-22 00:45:13

mrn0body
Scratcher
Registered: 2012-12-11
Posts: 37

Re: Help with Enemys

try this block:

<[ ] > [ ]>
This is so if it goes over 180 y then something happens.


Why Fit In When You Were Born To Stand Out

Offline

 

#4 2013-01-22 06:07:58

ianthestuntman
Scratcher
Registered: 2013-01-02
Posts: 100+

Re: Help with Enemys

when gf clicked
repeat until [<[y position]<[180]>]
change y b [-5]
end
hide

Offline

 

#5 2013-01-23 14:05:00

Zebus
New Scratcher
Registered: 2013-01-21
Posts: 14

Re: Help with Enemys

ok i think i asked this wrong lets try again but with some of the sugestions that you guys made

repeat until y > -180 (this is the bottom of the screen preaty much)
change y by -5
if y > -180
hide
and
go to x: pick random -200 to 200 y:187(after it reachs the bottom it will hide and go  back to the top into a random x postion and a set y postion)

i think thats the correct thing...thank you once again guys for the help

Offline

 

#6 2013-01-23 16:08:45

Zebus
New Scratcher
Registered: 2013-01-21
Posts: 14

Re: Help with Enemys

ok i figured it out ya!

[scratchblocks]
when gf clicked
forever
if [y position < -180]
  hide
  goto x: [pick random -200 to 200] y: [187]
  show
else
  change y by [-3]
end
end
[/scratchblock]

hope i typed that some what right

Offline

 

Board footer