I want help...(Little advance)

Hello everyone, Merry Christmas! :smiley:
I want share my project demo on Christmas! XD But I want some help. :astonished:
Below is my problem…

I want someone who can learn me this all with function. Thanks. :slight_smile:
(PS: Have someone help me this project, I will credit you in my game, really. :wink: )

Personally I don’t have time to teach you and explain everything step by step maybe someone else can, but since you are about to release a demo I think a little explanation should be enough.

What I would do, every X frame (use a timer here) create a small object at position of the NPC, link it to the NPC using the object linking extension, and move it toward the player. If any of this object is in collision with the player that means the NPC can see the player.
Obviously destroy the objects in case it is in collision with the wall or too far from the enemy. Think of it the enemy is constantly shooting bullets toward the player but this bullets are not to cause damage but check if the player is visible, and not behind a wall…etc
So when an object is colliding with the player, you can do many things depends on what you really need.
First with the object linking extension take in to account the NPC linked to the object collided with the player so you are triggering actions only on the NPC can see the player and not also the ones that can not see the player.
Pick the player X and Y position in to two object variable of the NPC and start moving the NPC toward that position stored in the variable.
In case the player run away and no longer visible to the NPC, the NPC can still move toward it last known position.
In case you want it to work only in a radius, you can check distance between the NPC and player or may even mark a point in the scene with an object or something and check distance between the object and the NPC to make sure the NPC does not go too far out of the radius…

What I would do, is simply randomize if a bullet causing damage or not and in case it does, how much. But in case you want it to be visible if a bullet is miss or hit, then simply just move the bullet toward a random range or angle.
Normally, I move bullet toward their own angle “bullet.Angle()” It make it easier to make every single bullet move toward their own direction individually.
So, to randomize it probably I would pick a random angle for each bullet like “bullet.Angle() + Random(30)” for example.
You can replace the 30 with a variable returning a value using a bunch of calculation made with skill, weapon…etc
The smaller the value the more accurate the force.

Now, this is the point when I doubt you are about to release a demo and I believe you just want someone to make the game for you.
If you can shoot one bullet, you should be able to shoot multiple ones the same way.
But in case you don’t know how to shoot a bullet, it is already explained in the beginner tutorial:
wiki.compilgames.net/doku.php/gd … rtutorial2

If you managed to shoot a single bullet, you can use the Repeat event to repeat it multiple times and create more bullets the same time as many you want.

I’m sorry but I really don’t want to explain how to do such a basic thing, how to use timers is already explained in the beginner tutorial. You should start there:
wiki.compilgames.net/doku.php/gd … rtutorial2

You can find many more tutorials and examples on the wiki:

Hey~Thanks for help. :smiley: About demo…This is not successful, because have some problem, so sad :frowning: . Demo will be delay…I will post more stable version on this website. :slight_smile:
(PS: I not want post a broken and boring’s demo. :confused: