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
Yes, the internal variable for an object's speed in Game Maker is <Object_Name>.speed.
use the action with the big up arrow
objectfollow = name or id of object to follow. spd = speed to follow. { if collision_point(self.x,self.y,objectfollow,true,true) = false { mp_potential_step(objectfollow.x,objectfollow.y,spd,true) } }
In the step event, add a move towards action and put x as object1.x. Put y as object1.y. Enter the desired speed below. Of course, this is only an example and you would have to replace object1 (in both places) with the name of the object to be followed.
You have to make a collision event with the objects you want it to stop at. And then make itMove to Contactdirection -- 0maximum -- 12against -- solid objects or all objects; If the object you are colliding with is not solid choose the second optionI hope this was helpful.
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.
Yes, the internal variable for an object's speed in Game Maker is <Object_Name>.speed.
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.
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.
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.
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)
A sprite cannot contain code.
by doing programming and cordial
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.
Je moeder is gay.
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.
use the instance_create function