04-28-2020, 11:12 AM
I'm trying to make it so that the brick blocks break when Mario walks into them from an angle. When I tried to do it, nothing happened!
Here's my code:
(In the obj_brickblock object)
What do I do?
Here's my code:
(In the obj_brickblock object)
Code:
Collision Event with object obj_mario:
execute code:
if (global.powerup == 15)
{
alarm[0] = 2
}
Alarm Event for alarm 0:
execute code:
sound_play(snd_break);
score += 50
{
ID = instance_create(x+8,y+8,obj_shard)
{
with (ID) motion_set(45,6)
with (ID) sprite_index = spr_shard_t
}
ID = instance_create(x+8,y+8,obj_shard)
{
with (ID) motion_set(60,6)
with (ID) sprite_index = spr_shard_t
}
ID = instance_create(x+8,y+8,obj_shard)
{
with (ID) motion_set(120,6)
with (ID) sprite_index = spr_shard_t
}
ID = instance_create(x+8,y+8,obj_shard)
{
with (ID) motion_set(135,6)
with (ID) sprite_index = spr_shard_t
}
}
with (self) instance_destroy()