B
Beersy
Guest
I was wanting to have enemies flash to invert when they take damage. I cant find a way to make the image go invert for a split second before returning to iuts normal image
This would flip the image itself, not the colors.Do you mean something like image_xscale = -1; ?
I thought he meant to say 'flip' the image, now that i re-looked at the question i can see what he is asking for.This would flip the image itself, not the colors.
hurt = false; //Set it to true whenever the player is hurt
flash = false;
if (hurt && alarm[0] < 0) {
alarm[0] = 0.5 * room_speed;
}
else {
flash = false;
}
flash = !flash;
if (flash) {
//Draw self affected by the shader
}
else {
//Draw regular self
}
Use shaders. This pack has a shader that you can use to invert colours of the sprite:
https://marketplace.yoyogames.com/assets/261/free-shaders
Use a variable and an alarm event to create a flashing effect. For instance:
Create:
Step:Code:hurt = false; //Set it to true whenever the player is hurt flash = false;
Alarm 0:Code:if (hurt && alarm[0] < 0) { alarm[0] = 0.5 * room_speed; } else { flash = false; }
Draw:Code:flash = !flash;
Code:if (flash) { //Draw self affected by the shader } else { //Draw regular self }
The reason being...all my projects are coded in 8.1...and a friend of mine said there's a lot of GML in 8.1 that doesnt work or transfer over with studio. The last time I checked studio was like a 100 dollars and havent really looked into getting it...i would love to get into studio but im not sure if i have to re learn GML for studio...i could be wrongShaders are GM:S-only. If you're still using GM8.1, I would highly recommend that you upgrade to GM:S.
Or is there a reason behind that?
I had no idea....is there a lite studio then a standard version? cuz i have game maker 8.1 pro version that i had to purchase.Studio is free, it only costs money if you want to export your projects to other platforms(like android or ios) or release assets to the markeplace.
The reason I say that is...he had studio and he tried to transfer one of my GM.8 games into studio, and he said some of my formulas didnt transfer over because it didnt recognize some variables..it was a long time ago i dont remember exactly what he saidHere's a comparison between the paid and free versions of GMS:
http://help.yoyogames.com/hc/en-us/articles/216754968-Which-Version-Of-GameMaker-Studio-Is-For-Me-
The Standard (free) version of Studio has way more features than the paid version of GM8.1, plus support for shaders that you want in this case. It doesn't have absurd limitations that the Lite version had either.
And no, you don't need to learn GML again. Slap hard whoever told you that! ^^"