Games By This Creator
Favourite games
- Member has no favourite games.
Recently Played Games
Comments By This Member
about 1 year ago -X- commented on the member Atizoa
I need help with some thing. I know I ask for help a lot lol but I,m still new...ish I need to make it so my enemy only shoots when the player gets close to him. Like setting a view. sight = 124; Then I don't know how to make the enemy shoot at an even pace when close to the player.
about 1 year ago -X- commented on the member Atizoa
Hey I just put the game up and it still needs a ton of work I know. This should give you a good idea of what i need i would also like u to read the description on the game it would help you understand it much more. I did rush the description so it has grammar fails in. If you need to know some thing then just ask.


Atizoa
said 11 months ago
Did you get the help you needed?
Atizoa
said about 1 year ago
final step setting up "shot_time".
1. set it to zero in your create event.
2. at the beginning of your step event make it so the it goes down if greater then 0.
putting all your final code in the step event of your "enemy" it should look like the following.
if shot_time>0
shot_time-=0.5
if distance_to_object(obj_player)<sight
{
if shot_time=0
{
var bullet;
bullet=instance_create(x,y,obj_bullet);
bullet.direction=bullet_direction;
bullet.speed=5;
shot_time=3;
}
}
Atizoa
said about 1 year ago
Now how you will use point direction will be the following-
bullet_direction=point_direction(x,y,obj_player.x,obj_player.y)
this line of code is key in the following steps-
0. Check if shot_time = 0
1. make an instance of bullet
2. set the direction
3. set the speed
4. set the shot_time = (your choice i prefer 3)
now how you make this in code is the following -
if shot_time=0{
var bullet;
bullet=instance_create(x,y,obj_bullet) bullet.direction=bullet_direction
bullet.speed=5
shot_time=3
}
Atizoa
said about 1 year ago
all right here we go . First you want the distance to an object to be specified. IE: *sight* . lets say it equals "100" . Now when the player is in reach of 100 pixels to it the enemy does something.
Now here is a handy function called distance_to_object. its so simple a cave man can do it! Use it in code like this. FYI "<" is smaller than
if distance_to_object(obj_player)<sight
{
"shoot"
}
The "shoot" part will be this -
Use another helpful function called point_direction