• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Windows Can't create debris of space rocks tutorial

J

João Vitor Barbosa

Guest
(I usually just read in english, sorry for miswriting)

I tried to destroy bullet after trying to create debris, erase the debris image_alpha -= 0.01 and destroy part, resize to 5x5... and still not creating debris (yes, I saved everytime).


upload_2019-3-22_1-13-31.png

upload_2019-3-22_1-15-33.png
upload_2019-3-22_1-16-14.png
 
T

Taddio

Guest
You have a typo, remove the | in your (x,y) when you create the debris
 
The code you posted looks ok to me.

Try putting a show_debug_message("Debris Created") in the Create Event of obj_debris to confirm if they are actually being created or not.
 
J

João Vitor Barbosa

Guest
I removed again the alpha -=1 and the destroy() call in obj_debris, and played. And just after I destroyed all the asteroids, the debris came slowly from de left... Maybe they are been created out of the screen ? But why ?

upload_2019-3-24_1-49-34.png
 
Last edited by a moderator:
A few things you could try.

Move the instance_destroy() commands in the obj_asteroid collision event to after the other code has run. It shouldn't make a difference, but perhaps the fact you are running instance destroy() is messing with the obj_asteroids x and y position.

Put a:

show_debug_message("Position created at: " + string(x) + "/" + string("y"))

in your obj_debris Create Event, to test where the debris starting position is.

Check the sprite spr_debris Origin coordinates are set to the center of the sprite.
 
J

João Vitor Barbosa

Guest
A few things you could try.

Move the instance_destroy() commands in the obj_asteroid collision event to after the other code has run. It shouldn't make a difference, but perhaps the fact you are running instance destroy() is messing with the obj_asteroids x and y position.

Put a:

show_debug_message("Position created at: " + string(x) + "/" + string("y"))

in your obj_debris Create Event, to test where the debris starting position is.

Check the sprite spr_debris Origin coordinates are set to the center of the sprite.

thanks, the Sprite origin was the problem

upload_2019-3-24_2-16-43.png
 
G

Genjiro

Guest
Hello,
I am having the same problem that the debris is not shown.
I have added the "Show debug message" and it is shown .

What do you exactly mean with "thanks, the Sprite origin was the problem"?

I just have solved it.
I had put the following event in the wrong place, on the buttom instead of the right.
 
Last edited by a moderator:
Top