1
The Lounge / Re: Here is Practical Explanation about Next Life, Purpose of Human Life,
« on: June 03, 2019, 05:08:16 PM »
Fuck off
Bet you can't even cancel properly
Bet you can't even cancel properly
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
with(objPlayer)
other.gravity_direction=point_direction(other.x,other.y,x,y);
image_xscale = 0.75;
image_yscale = 0.75;
growing = true;
growing_rate = 0.1;
max_size = 1.25;
min_size = 0.75;
if(growing == true)
{
image_xscale += growing_rate;
image_yscale += growing_rate;
}
else
{
image_xscale -= growing_rate;
image_yscale -= growing_rate;
}
if(image_xscale >= max_size || image_xscale <= min_size)
growing = !growing;
time = 0;
growth_rate = 0.1;
time += growth_rate;
image_xscale = 1+0.25*sin(time);
image_yscale = 1+0.25*sin(time);
This is the code I tried, and as I said I want it to make the object be destroyed if the amount of true secrets is less than 8, but the object is being destroyed only when the amount is exactly 7 true secrets. I didn't find some way to count variables like we can count instances using "instance_number".Code: [Select]if global.secretItem[1] = true
if global.secretItem[2] = true
if global.secretItem[3] = true
if global.secretItem[4] = true
if global.secretItem[5] = true
if global.secretItem[6] = true
if global.secretItem[7] = true
if global.secretItem[8] = true{
//nothing happens
}
else{
instance_destroy()}
if global.secretItem[1] = true
if global.secretItem[2] = true
if global.secretItem[3] = true
if global.secretItem[4] = true
if global.secretItem[5] = true
if global.secretItem[6] = true
if global.secretItem[7] = true
if global.secretItem[8] = true
{
//nothing happens
}
else
{
instance_destroy()
}
The else statements affects only the last if, so the code gets executed if and only if the first seven secrets are true and the last one is false.if(!(global.secretItem[1] == true &&
global.secretItem[2] == true &&
global.secretItem[3] == true &&
global.secretItem[4] == true &&
global.secretItem[5] == true &&
global.secretItem[6] == true &&
global.secretItem[7] == true &&
global.secretItem[8] == true))
{
instance_destroy();
}
! is the logic negation, && the logic AND