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

#1 2010-07-18 09:44:17

Jagex666
New Scratcher
Registered: 2010-07-18
Posts: 1

How do I make people attack the player?

I'm making a game where you start of in the center of map but zombies are chasing you... they chase you and follow you but they don't hurt you! Please tell me how to make them harmful!

Offline

 

#2 2010-07-18 09:47:28

coolstuff
Community Moderator
Registered: 2008-03-06
Posts: 1000+

Re: How do I make people attack the player?

Make a variable for the player's health.

Then do something like this:

When Green Flag clicked
forever
  if <touching [zombie]>
    change health by -1
    wait until <not <touching [zombie] > >

That should make it so that if it's touching the zombie, the health will go down by one, and it will wait until it's not touching the zombie (because it'll likely go away). If you have multiple zombies, you'll have to implement those in the "if" statement.

Offline

 

#3 2010-07-18 10:55:18

MaxtheWeirdo
Scratcher
Registered: 2010-03-18
Posts: 500+

Re: How do I make people attack the player?

Or, put the if statements on the zombies. Make it , instead of the if touching zombie, the if touching player.


My website. Hall Crawler My Awesome OS
It's just marketing, guys! Nothing sinister!

Offline

 

Board footer