answersLogoWhite

0

Depends on what type of attack you are trying to achieve, you did not provide enough information. but ill try to help anyways.

for a platform game, if by attack you mean shoot, then simply make an object that you want to use as a bullet, and then for the keypress event for shooting, simply add a code which creates an object, gets its ID, then sets the speed in the desired direction. example:

B=instance_create(x,y,obj_bullet); //create a bullet and save its ID in the variable 'B'

B.direction=direction; //the direction we want the bullet to go.

B.speed=12; //make the bullet move with the speed of 12

now simply add collision events within the bullet object, and lets say, for example, it hits an enemy, you would either destroy the enemy, or subtract lives from it.

for this example, lets say your enemy has a variable called "hp" which is how many lives it has. Now whenever it is hit by a bullet, it will lose 5 lives, and if its lives go below zero, or equal zero, it is destroyed.

First, we want to give the enemy lives, so in the create event we will add this piece of code:

hp=20; // the amount of lives the enemy has

then in the collision event we simply subtract 5 hitpoints, and destroy the bullet so we dont lose lives again.

hp-=5; //subtract 5 hp

/*destroy the bullet. in collision events, the object that collides ID is saved into the variable "other" so we can use that for things like destroying it, reading data, changing its direction/variables, and pretty much anything else you can think of. */

with(other)

{instance_destroy();}

Hope that helps. you didn't provide enough information, so I cant give you an exact solution.

~grumpymonkey from the GMC

User Avatar

Wiki User

16y ago

What else can I help you with?

Related Questions

What is a video game maker?

someone who makes a video game


Can someone help you with Game Maker 8?

Be more specific.


Who is the game maker?

Sorry, But this area is for game maker questions only, GAME MAKER, As in the PROGRAM GAME MAKER, Not Other Game Makers, Game maker is owned by yoyo games, So please dont post questions about other game makers here, but, to answer your question, game maker is the best game maker, just search yoyogames game maker in Google UK.


What is the 3d game maker password?

It costs 20$ and to have someone give you the code is ILLEGAL.


Can you transfer a game from game maker to game maker studio?

yes


What is game maker 7 pro activation code?

The Game Maker 7 Pro activation code allows you to upgrade from Game Maker 7 Lite to Game Maker 7 Pro.


What is an animated walkthrough?

well, what I think an annimated walkthrough is, and probaly is at that, a video of the game being played as the maker of the video (or someone the maker has entrusted with the job) saying what to do on the missions.


Can you get Game Maker without downloading?

If your talking about the game maker at "yoyogames.com", then no.


What is a good video game maker for a beginner?

Game maker from yoyogames.


What is the game maker serial number?

its a different code for every purchase, and once the code is used, that number expires. so unless you purchase game maker(or someone else does) you cannot use the same number twice.


Where can you get game maker 7pro?

Game Maker 7 Pro can be bought for about 20 US dollars at the official Game Maker website (www.yoyogames.com)


How do you edit exe in game maker?

Executables (even compiled by Game Maker) are not possible to edit in Game Maker. To edit it you would have to decompile or disassemble it, or use a hex editor. Game Maker can only edit files such as *.gmk, *.gm81 and older versions of the Game Maker files.