Hello scratch!
I might be doing this kind of space invaders/star fox kind of game.
I'll try to explain in more detail.
You are in a ship and go through scroll y blasting 100s of little ships to get to your destination. The little ships will try to stop you and fire at you. How do i make them fire at me? I'll try it later and i'll come up with the results.
http://scratch.mit.edu/projects/Stickman704/478438
i've done it fine. So...
<{ X of you }>
<{ Y of you }>
You:
<when green flag clicked>
<forever>
<set{ X of you }to( <x position>
<set{ Y of you }to( <y position>
<end>
Enemy:
<when green flag clicked>
<forever>
<wait( 3 )secsc>
<broadcast[ Fire
<wait( 3 )secsc>
<end>
Blast:
<when green flag clicked>
<go to[ Enemy
<forever if><touching[ Death box for blast
<go to[ enemy
<end>
<when I receive[ Fire
<glide( 3 )secs to x <{ X of you }> )y
<{ Y of you }>
<go to[ enemy
Death box for blast:
<when green flag clicked>
<forever>
<set[ Ghost ]effect to(100
<end>
is there a quicker way?
Last edited by Stickman704 (2009-04-05 13:05:43)
Offline
try use as many local variables as possible when making AI
Offline
Don't use the glide block. That'll make the AI dumb as heck >_>
First, click the [<-->] icon at the left of the sprite thumbnail, above the "Scripts" tab. That'll make it aim to only 2 directions, no matter if the direction isn't 90 or -90.
Then, use this:
[blocks]
<when green flag clicked>
<forever>
<point towards( player
<move( 5 )steps> --Change this to what you'd like. You can also use a "Pick Random" block.
<end>[/blocks]
Last edited by technoguyx (2009-05-21 11:45:44)
Offline
Space shooters don't have enemy AIs. They have pre programed routines for the enemies.
Offline