I'm new to the side scroller shooting games, and was going to make a half life game on scratch. But I need help with the stupid AI. How to make it shoot at you and randomly hit, the works.
I know:
[blocks]<when green flag clicked>
<forever if><( <distance to[ sprite]> <<> whatever you want )>
<set{ variable }to( <pick random( 0 )to( 10) >[/blocks]
[blocks]<when green flag clicked>
<forever if> <( <{ variable }> <=> 5 or something )>
<change{ p1hp }by( 5>[/blocks]
Last edited by MasterStrife (2009-07-31 19:19:13)
Offline
you could have tiney marks after the shooting sprite aso it could shoot you when touching or you could have if distance from ! thats two ways
Offline
try this:
<when green flag clicked> <forever> <if><( <distance to[ Player ]<<> 300 or whatever )> (Execute attack) <end> <end>
if that doesn't work ill try to to fix it.
Offline
Thats exactly what i put up on first post -.-
Offline
so, you need help with the shot?
ENEMY
<when green flag clicked>
<forever>
<if><( <distance to[ Player ]<<> 300 or whatever )>
<broadcast[ fire]
(Execute attack)
<end>
<end>
PLAYER
<when I receive[ fire]
<set{ Ran. }to( <pick random( 1 )to( 0 )
<if><( <{ Ran. }> <=> 1 )>
<change{ Health }by( -1 (or whatever) )
(Execute hurt)
<end>
<end>
Offline