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

#1 2011-08-17 11:45:17

timetravelernick
Scratcher
Registered: 2010-11-26
Posts: 27

how dp you make a enmey shoot at the player

i am making a minecraft type of game i need a enmey to shoot.

Offline

 

#2 2011-08-17 12:44:40

PlutoIsHades
Scratcher
Registered: 2010-10-18
Posts: 1000+

Re: how dp you make a enmey shoot at the player

Make, say, an arrow, a sprite.

Then:
[blocks]<when green flag clicked>
<hide>
<if>
<go to[ Enemy
<show>
<glide( 1 )secs to x sad  X position of Player )y sad  Y position of Player[/blocks]

(X position of - and Y position of - are blocks in sensing.)
Hope this helps!


Minecraft, Redwall, and Cyberchase fan, and PROUD.

Offline

 

#3 2011-08-17 12:49:02

timetravelernick
Scratcher
Registered: 2010-11-26
Posts: 27

Re: how dp you make a enmey shoot at the player

thanks

Offline

 

#4 2011-08-17 14:00:13

Thescratch3
Scratcher
Registered: 2011-06-14
Posts: 1000+

Re: how dp you make a enmey shoot at the player

PlutoIsHades wrote:

Make, say, an arrow, a sprite.

Then:
[blocks]<when green flag clicked>
<hide>
<if>
<go to[ Enemy
<show>
<glide( 1 )secs to x sad  X position of Player )y sad  Y position of Player[/blocks]

(X position of - and Y position of - are blocks in sensing.)
Hope this helps!

Well it won't because it will always go to the player. You should say instead of Gliding, try this:

show
repeat until touching player OR edge OR a ground
move 10 steps
hide
go to enemy

This should work more efficiently.


View my projects. Or face The scratch curse! (Get it?)
http://i56.tinypic.com/2cdk8hy.png

Offline

 

#5 2011-08-17 17:04:28

henley
Scratcher
Registered: 2008-06-21
Posts: 1000+

Re: how dp you make a enmey shoot at the player

Just download this project as an example.


"I've worked so hard for you and you give me nothing in return. Do you need help... Or do I?"

Offline

 

#6 2011-08-17 19:12:03

PlutoIsHades
Scratcher
Registered: 2010-10-18
Posts: 1000+

Re: how dp you make a enmey shoot at the player

Thescratch3 wrote:

PlutoIsHades wrote:

Make, say, an arrow, a sprite.

Then:
[blocks]<when green flag clicked>
<hide>
<if>
<go to[ Enemy
<show>
<glide( 1 )secs to x sad  X position of Player )y sad  Y position of Player[/blocks]

(X position of - and Y position of - are blocks in sensing.)
Hope this helps!

Well it won't because it will always go to the player. You should say instead of Gliding, try this:

show
repeat until touching player OR edge OR a ground
move 10 steps
hide
go to enemy

This should work more efficiently.

Okay, I get what you're saying.  Thanks for correcting me.  smile


Minecraft, Redwall, and Cyberchase fan, and PROUD.

Offline

 

Board footer