I am making a top down flying game with the SGDK what i am wondering is how to you make the enemies shoot. Is there a script for them or is it a special function?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This was a topic on the message board very recently. You could try doing a search on it. But since you asked, I made a tutorial from my original response, which can be found here:
There is 1 way of making enemies shoot without script that i am aware of...
*Create a Sprite called "TRIGGER" that starts relatively close to your ENEMY sprite(s).
*Set TRIGGER's speed to 10, Intertia to 100, and set its motion to (Move towards ENEMY sprite)
*Create a sprite Called "ENEMYBULLET"
*Create a function called "ENEMYFIRE" that will create ENEMYBULLET sprite.
*Set ENEMYBULLET's motion to (Move towards Player Sprite)
*Create a collision between ENEMY sprite and TRIGGER that will activate ENEMYFIRE function.
END RESULT: When the TRIGGER sprite collides with the ENEMY sprite, it will create the sprite BULLET, which is set to move towards your Player Sprite.
-sCaReCrOw
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am making a top down flying game with the SGDK what i am wondering is how to you make the enemies shoot. Is there a script for them or is it a special function?
This was a topic on the message board very recently. You could try doing a search on it. But since you asked, I made a tutorial from my original response, which can be found here:
https://sourceforge.net/docman/display_doc.php?docid=25179&group_id=9970
There is 1 way of making enemies shoot without script that i am aware of...
*Create a Sprite called "TRIGGER" that starts relatively close to your ENEMY sprite(s).
*Set TRIGGER's speed to 10, Intertia to 100, and set its motion to (Move towards ENEMY sprite)
*Create a sprite Called "ENEMYBULLET"
*Create a function called "ENEMYFIRE" that will create ENEMYBULLET sprite.
*Set ENEMYBULLET's motion to (Move towards Player Sprite)
*Create a collision between ENEMY sprite and TRIGGER that will activate ENEMYFIRE function.
END RESULT: When the TRIGGER sprite collides with the ENEMY sprite, it will create the sprite BULLET, which is set to move towards your Player Sprite.
-sCaReCrOw