P
piksil_demon
Guest
ok, the problem im having is this- when i shoot the spike bomb, it does destroy itself, but it only spawns one spike that goes right. can you tell me whats wrong with my code, and how to properly spawn all 8? p.s. parent is a blank object.
p.p.s. the alarm in the "exploded" is to give it some invincibility frames after spawning
and yes, ill be switching to states soon, im using this as a trial run
p.p.s. the alarm in the "exploded" is to give it some invincibility frames after spawning
and yes, ill be switching to states soon, im using this as a trial run
Code:
Information about object: obj_spikebomb
Sprite: spr_spikebomb
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
hp=10
Step Event:
execute code:
if hp <=0{{
instance_create(x,y,obj_spikebomb_exploded) image_angle=0;
instance_create(x,y,obj_spikebomb_exploded) image_angle=45;
instance_create(x,y,obj_spikebomb_exploded) image_angle=90;
instance_create(x,y,obj_spikebomb_exploded) image_angle=135;
instance_create(x,y,obj_spikebomb_exploded) image_angle=180;
instance_create(x,y,obj_spikebomb_exploded) image_angle=225;
instance_create(x,y,obj_spikebomb_exploded) image_angle=270;
instance_create(x,y,obj_spikebomb_exploded) image_angle=295;
}
instance_destroy()}
Information about object: obj_spikebomb_exploded
Sprite: spr_spikebomb_exploded
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_parent
Children:
Mask:
No Physics Object
Create Event:
execute code:
alarm[0] = room_speed*.1
hp = 10
speed = 10;
direction = image_angle;
Alarm Event for alarm 0:
execute code:
//just here to turn on alarm
Step Event:
execute code:
if alarm[0]=0
{if place_meeting (x,y,obj_player) {global.hp -= 25}
if instance_place (x,y,obj_spikebomb){obj_spikebomb.hp-=25}
if hp<=0 {instance_destroy()}}