Okay. So, as some of you may know, my latest endeavor is a Shmup by the name of
Last Fighter D. I am having the strangest of bugs.
Basically, I have a last type enemy weapon. For whatever reason, when it fades and erases, if the player is in contact with it, the game freezes. Would anyone be able to say why?
Relevent Codes:
Player Bullet Collision Code:
if death=true
exit;
if visible=true and other.canhurt=true and invincible=false and instance_exists(obj_bomb)=false
{
mask_index=spr_corecheck
if place_meeting(x,y,other)=true
{
death=true
alarm[2]=1
}
else
{
dir=point_direction(x,y,other.x,other.y)
instance_moving(x+cos(degtorad(dir))*12,y-sin(degtorad(dir))*12,obj_grazepart,dir,3)
grazecount+=1
bombs=approach(bombs,3,0.01/max(ceil(bombs),1))
}
mask_index=sprite_index
}
Laser Beam:
Information about object: obj_laserbeam
Sprite: spr_laserbeam
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_enemyshottemplate
Mask: <same as sprite>
Create Event:
execute code:
event_inherited()
dist=0
dir=0
xnum=0
ynum=0
image_yscale=0.1
canhurt=false
widen=false
Begin Step Event:
execute code:
if image_yscale=1
canhurt=true
else if image_yscale<0.9
canhurt=false
End Step Event:
execute code:
if instance_exists(master)=false
{
instance_destroy()
exit
}
image_angle=master.image_angle
image_alpha=master.image_alpha
image_yscale=master.image_yscale
dir=image_angle
ynum=(-(sin(degtorad(dir)))*dist)
xnum=((cos(degtorad(dir)))*dist)
x=master.x+xnum
y=master.y+ynum
Laser Source:
Information about object: obj_lasersource
Sprite: spr_enemlasersource
Solid: false
Visible: true
Depth: 0
Persistent: false
Parent: obj_enemyshottemplate
Mask: <same as sprite>
Create Event:
execute code:
event_inherited()
image_yscale=0.1
alarm[0]=15
widen=false
alarmnum=15
Alarm Event for alarm 0:
execute code:
widen=true
Alarm Event for alarm 1:
execute code:
instance_destroy()
Alarm Event for alarm 2:
execute code:
alarm[1]=15
Step Event:
execute code:
if widen=true
image_yscale=approach(image_yscale,1,0.09)
if alarm[1]>0
{
widen=false
image_alpha-=image_alpha/alarm[1]
image_yscale-=image_yscale/alarm[1]
}
if image_yscale=1 and alarm[2]=-1
alarm[2]=alarmnum
End Step Event:
execute code:
if instance_exists(master)=false
{
instance_destroy()
exit
}
ynumb2=(-(sin(degtorad(master.image_angle)))*xnumb)
xnumb2=((cos(degtorad(master.image_angle)))*ynumb)
ynum=(-(sin(degtorad(image_angle)))*dist)
xnum=((cos(degtorad(image_angle)))*dist)
x=master.x+xnum+xnumb2
y=master.y+ynum+xnumb2
For the source object, "master" is the firing enemy. For the beam, "master" is the relevent source.
If any more information is required, feel free to ask for it.