How do you make enemies that are actually good? I mean enemies that fight back and stuff, and can make simple decisions like which dirrection to go to avoid things and stuff. Thanks
Offline
Well, this would involve a very complicated type of programming called Artificial Intelligence, or AI. It's difficult to explain, because it varies for each place in which it's used, but you'd have to go through what decisions YOU would make in certain circumstances, and program the project to do the same thing... Go where your heart tells you!
Offline
What you want to do is complex, so I'll show you a few lines of code you could use.
This line of code would make the enemy point towards the user, and follow it. You can change the speed it follows the user.
[blocks]
<when green flag clicked>
<forever>
<point towards( user
<move( speed )steps>
[/blocks]
If the enemy was trying to avoid the user, you could do this:
[blocks]
<when green flag clicked>
<forever>
<point towards( user
<turn cw( 180 )degrees>
<move( speed )steps>
[/blocks]
*Note: this script will probably only work online, or in full-screen more
You could use similar scripts for bullets too.
Did that answer your question?
Offline