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

#1 2011-07-01 14:10:44

calebxy
Scratcher
Registered: 2009-12-31
Posts: 1000+

How do I...?

How do I have an enemy chasing you, so that he comes towards you when you're not moving, but he moves backwards slowly when you move forward?


I'm making my own Doctor Who series!  big_smile  See the first episode here.
And please join Story Zone!  big_smile

Offline

 

#2 2011-07-01 14:30:31

brettman98
Scratcher
Registered: 2010-10-17
Posts: 1000+

Re: How do I...?

have a variable titled moving.
on your character:
[if <<key[up]pressed>or<key [down] pressed>>]
[set moving to yes]
[else]
[set moving to no]

on the enemy:
[if <(moving)=yes>]
[point towards (character)]
[move -1 steps]
[if <(moving)=no>]
[point towards (character)]
[move 1 steps]

you can also add left and right arrows if they are used and change the number of steps to go fast/slow.


http://i40.tinypic.com/n1wbr7.jpg

Offline

 

Board footer