I'm getting ready to begin my third installment of the Monkey Ninja series. However, I'm having a great deal of trouble trying to get enemies to appear and walk about and creating a script to get the character to fire weapons. Can someone help me out?
Offline
You could try out my Tanks game in my signature, it has some stuff like that in it.
Offline
pjt4jc wrote:
I'm getting ready to begin my third installment of the Monkey Ninja series. However, I'm having a great deal of trouble trying to get enemies to appear and walk about
It sounds like you're trying to create some basic artificial intelligence for your enemies. There are many ways of approaching this, and because I don't know the structure of your program, I'll try to keep this pretty generic.
To get the enemy sprites to appear, you could set up a script in the stage like this:
when gf clicked forever if <(enemy)=[dead]> wait <pick random (1) to (10)> secs //change this to whatever you want broadcast [show enemy v]Then in the enemy's scripts, add something like this:
when I receive [show enemy v] show do ai stuffAs for getting the enemies to walk around, you could use something as simple as this:
forever point towards [main character v] move (5) steps
pjt4jc wrote:
and creating a script to get the character to fire weapons.
For firing weapons, I would create a "bullet" sprite, and add a script like this:
When [space v] key pressed show go to [main character v] point in direction ([direction v] of [main character v]) repeat until <<touching [edge v]?>or<touching [other enemies v]?>> move (8) stepsHope this answered your questions!
Offline
Thanks
Offline