• 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!

GML collision of a draw_sprite_ext

D

Denis Elias

Guest
Hi
I have that fancy laser beam shooting from my ship up to the end of the room with this code:
Alarm[0] is set to 30 frames for a fade out.

var i = y;
while (i! = 0)
{
draw_sprite_ext(spr_laser, 0, x, y-i ,1 , 1, 90, c_white, alarm[0]/30);
i -= 1;
}

Now I want to check for collisions with the drawn sprite. With my normal collision checks in the events, nothing is happening...
How do I get the collision event to notice that there is something?
 
F

Frisk17

Guest
Hi
I have that fancy laser beam shooting from my ship up to the end of the room with this code:
Alarm[0] is set to 30 frames for a fade out.

var i = y;
while (i! = 0)
{
draw_sprite_ext(spr_laser, 0, x, y-i ,1 , 1, 90, c_white, alarm[0]/30);
i -= 1;
}

Now I want to check for collisions with the drawn sprite. With my normal collision checks in the events, nothing is happening...
How do I get the collision event to notice that there is something?
You should put code like this:
Code:
//Code
Did you put the collision mask? Did you used simple or advanced collision? Please details..
Also maybe it's typing error in thread only but
Code:
while (i != 0)
Rather than i! = 0
 

NightFrost

Member
Drawing multiple sprites will not change an instance's collision mask. If you want to scale the sprite, you should set image_xscale or/and image_yscale, and use them on the ext draw. Setting the scale values will also scale the collision mask in required manner.
 
D

Denis Elias

Guest
Drawing multiple sprites will not change an instance's collision mask. If you want to scale the sprite, you should set image_xscale or/and image_yscale, and use them on the ext draw. Setting the scale values will also scale the collision mask in required manner.
What should my code look like?

When I do this there is no collision either..
while (i!=0)
{
draw_sprite_ext(spr_laser,0,x,y,1,i,0,c_white,alarm[0]/30);
i-=1;
}
And the sprite gets streched/scaled in both directions, up and down.
 
Top