answersLogoWhite

0


Best Answer

this is the code I always use:

bullet = instance_create(obj_enemyBullet);// create the bullet and store the ID in a variable
with(bullet){//start running code in the bullet
parentID = other.id;//set the enemy ID that is the parent to the bullet as a variable in the bullet
direction = (parentID).bulletDirection;//set the direction to a variable stored in the enemy
speed = (parentID).bulletSpeed;//set the direction to a variable stored in the enemy
//etc.
}


obj_enemyBullet is the object name of whatever the the enemy is shooting
bulletDirection is a variable in the enemy that contains the direction the bullet should move
bulletSpeed is a variable in the enemy that contains the speed the bullet should move
just copy/paste this code into the event that triggers the bullet firing and account for the mentioned variables. Credit Dr. Sakuya

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you make an enemy object shoot in game maker 7?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

How do you make a sprite shoot in game maker 7?

A sprite cannot do anything. If you meant "How do you make anobject shoot in game maker 7?" then it's easy.Create an object for your bullet and give it a sprite. Then in the object you want to shoot the bullet add a "create instance with motion" actionwith the bullet specified.Alternatively you could use a "create instance" action and then add an on creation, "move" action to the bullet.


Is there an internal variable for an object's speed in Game Maker?

Yes, the internal variable for an object's speed in Game Maker is <Object_Name>.speed.


How do you make an object shoot in game maker 7?

Depends. You could have it make a new object, for bullets as an example, you could have it make a line, for lasers as an example, you could have it do all sorts of things.


What kind of game is Castle Defense?

The game "Castle Defense" is a simple online game, where there is no need to download and has an easy interface. The object of the game is to defend your castle by buying different types of tanks to shoot the enemy.


How do you make a player shoot in a Game Maker game?

Create a bullet object and then use Create Moving Instance (I think that's what it's called)Should hopefully soon be merged with How_do_you_make_a_player_shoot_in_a_Game_Maker_gameUntil then, check out the answer over there.


How do you make an object in game maker come towards you when you get close to it?

To make Enemy go towards Player when in range. For Enemy object: On step: Execute Code: if(point_distance(Enemy.x,Enemy.y,Player.x,Player.y)<RANGE) { move_towards_point(Enemy.x,Enemy.y,SPEED) } (Replace RANGE with the range and SPEED with the speed)


How do you make a sprite shoot in game maker?

A sprite cannot contain code.


How do you make your sprite shoot in game maker 7 if it has turned?

by doing programming and cordial


How do you make a player shoot in a Game Maker?

Create a bullet object and then use Create Moving Instance (I think that's what it's called)Should hopefully soon be merged with How_do_you_make_a_player_shoot_in_a_Game_Maker_gameUntil then, check out the answer over there.


How do you make an object pick something up in a game maker game?

Je moeder is gay.


What is the goal in the game Tower Defence?

The goal of Tower Defense is to stop the enemy from crossing the map. This is done by constructing towers to shoot the enemy and traps to slow the enemy down.


How can you make an object appear on game maker in code?

use the instance_create function