M
Mihaugoku
Guest
So i've been playing around with scripts for a while and i encountered a weird bug just now. Sometimes when the player object is hit, the background may sometimes disappear.
A gif with what is happening is below:
https://media.giphy.com/media/dSdWqgUx5k7CHUF3gx/giphy.gif
I have no idea why this is happening, since those things are not related in any way..
The script is as follows:
And the background is set in the room options..
Also i did this simple thing with invulnerability frames, if it can mean anything:
There is no reference to the background ANYWHERE in the game.
If anyone knows, why this may happen, please let me know.
A gif with what is happening is below:
https://media.giphy.com/media/dSdWqgUx5k7CHUF3gx/giphy.gif
I have no idea why this is happening, since those things are not related in any way..
The script is as follows:
Code:
var inst = instance_place(x, y, obj_player);
with(inst) {
obj_player.damage = atk;
if type = 2 {
instance_destroy();
}
}
var atk_value = (damage - def);
if atk_value < 1 {
atk_value = 1;
}
hp -= atk_value;
iframes = 25;
xspd = (xspd / -xspd) * 3.5;
yspd = -5;
And the background is set in the room options..
Also i did this simple thing with invulnerability frames, if it can mean anything:
Code:
if iframes = 0 || (iframes mod 5) < 3 {
draw_self()
}
There is no reference to the background ANYWHERE in the game.
If anyone knows, why this may happen, please let me know.