My Game will not allow me to spawn new objects! - Gamemaker 8.1

In my game, I followed the Gamemaker instructions to create bombs but for my objects and for some reason it will not create them. Sorry for the badness but in endless mode please try it in the link to my drive.
 

TsukaYuriko

Q&A Spawn Camper
Forum Staff
Moderator
Please don't just dump your project files and expect others to download them and not only help you fix your problems, but also look for them in the first place. (Not that the link you posted even lets me download anything...)

So, please post any code you think may be relevant to this issue after isolating it as much as you can.
 

TheouAegis

Member
@HelpMyPoorGames.exe

instance_create(x, y, object)

Make sure that's the code you are using to create the instance of the bomb. If you want to create the bomb where the instance calling that code is and your bomb is called obj_bomb, then your code would be

instance_create(x,y,obj_bomb)

That works without fail. What doesn't work is if you have a conditional before that line of code and the conditional is wrong. For example

if keyboard_check_pressed("C") instance_create(x,y,obj_bomb)

Or another example

if keyboard_check_pressed(ord("c")) instance_create(x,y,obj_bomb)

In both those examples, the bomb won't be created because you didn't address the "C" key properly. The correct code would be

if keyboard_check_pressed(ord("C")) instance_create(x,y,obj_bomb)

Another common cause of confusion is there is some code in the player or in the bomb that immediately destroys the bomb upon collision with the player, so the bomb gets destroyed as soon as it is created -- it's still getting created, though.

Make sure the bomb can even be seen. Does it have a sprite assigned to it? Is the "Visible" box checked? Does the bomb NOT have a Draw Event? Is the depth of the bomb less than the depth of the background? Remember, the higher the depth (+1 and beyond), the earlier the image is drawn, so if a background has depth 0 and the bomb has depth 1, the bomb will be drawn behind the background and thus be invisible. In all of these cases, the bomb is still created, just not visible.
 
Top