此代码会在其运行状况达到 0 时销毁该对象,但不会将 5/7 添加到 global.xp 变量中。
if rotem_hp > 1 and shop_13 = 0
{
rotem_hp = rotem_hp -1
}
else
{
if rotem_hp > 1 and shop_13 = 1 rotem_hp = rotem_hp -1.5
if rotem_hp < 1 and shop_4 = 0 global.xp = global.xp + 5 instance_destroy()
if rotem_hp < 1 and shop_4 = 1 global.xp = global.xp + 7 instance_destroy()
}
这也行不通
if (rotem_hp > 1 and global.shop_13 = 0)
{
rotem_hp = rotem_hp -1
}
else if (rotem_hp > 1 and global.shop_13 = 1)
{
rotem_hp = rotem_hp -1.5
}
else if (rotem_hp < 1 and global.shop_4 = 0)
{
global.xp = global.xp +5
instance_destroy()
}
else if (rotem_hp < 1 and global.shop_4 = 1)
{
global.xp = global.xp +7
instance_destroy()
}
else
{
//do nothing
}
这不会破坏对象(顺便说一句,我有创建事件(rotem_hp = 5)
if rotem_hp > 1 and global.shop_13 = 0
{
rotem_hp = rotem_hp -1
}
if rotem_hp > 1 and global.shop_13 = 1
{
rotem_hp = rotem_hp -1.5
}
if rotem_hp < 1 and global.shop_4 = 0
{
global.xp = global.xp +5
instance_destroy()
}
if rotem_hp < 1 and global.shop_4 = 1
{
global.xp = global.xp +7
instance_destroy()
}
我将感谢任何努力回答我的问题。