• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM Bubble Shooter Game

FrostyCat

Redemption Seeker
As far as I'm concerned that line is doing exactly what we expect.

If you're implying that that line is one of the potential issues, instead of just blatantly referencing Morgan's laws why not elaborate on why you believe the line to not be doing what we want it too?
No, it absolutely isn't doing what you expect.
  • "slot is full" is characterized by !(inst == -1).
  • "unchecked" is characterized by !inst.checked.
Applying && to these to expressions results in !(inst == -1) && !inst.checked. According to De Morgan's Law, this is equivalent to !(inst == -1 || inst.checked) as I demonstrated, not !(inst == -1 && inst.checked) as seen in the original.

And here is another case of it happening:
Code:
if(!(x_offset == 0 && y_offset == 0))
      {//if both offset values are not zero
"if both offset values are not zero" is x_offset != 0 && y_offset != 0, which by De Morgan's Law is equivalent to !(x_offset == 0 || y_offset == 0), not !(x_offset == 0 && y_offset == 0).

If neither of you start applying De Morgan's Laws on your code, expect more logical fallacies like these to come your way.
 
M

Matt93

Guest
The array that is getting an out off range error is this one:

Code:
global.Y_LocationOfIndex
So we'll need to know how it is built up.
This is in my obj_control create event:
Code:
for(x=0; x<width;x++){//width represents the number of blocks in the width
   for(y=0; y<20;y++){
      global.X_LocationOfIndex[x,y] = 80 + 32 * x;
      global.Y_LocationOfIndex[x,y] = 40 + 32 * y;
   }
}
I have tried changing that y<20 to y<height but it doesn't seem to work. Is it possible that it's because I'm putting for (x=0) and for (y=0) rather than i and j, as I've been putting for my other for loops? Thank you so much.
 

FrostyCat

Redemption Seeker
Your code is actively moving the calling instance around the room, since x and y have special meanings in GM. Use i and j instead as instructed, or use xx and yy as a compromise. Also, since those iteration variables are temporary, I highly recommend that you use var to initialize them.
 
T

TDSrock

Guest
I can't so easily see right now what exactly is going wrong where.

FrotyCat's mention on the use of x and y is true, but in this case doesn't matter as we are using a controller object which is transparent and not used for anything.

Lets just get together and look through the code more carefully(via Skype/discord).
 
M

Matt93

Guest
I can't so easily see right now what exactly is going wrong where.

FrotyCat's mention on the use of x and y is true, but in this case doesn't matter as we are using a controller object which is transparent and not used for anything.

Lets just get together and look through the code more carefully(via Skype/discord).
Okay, that sounds good. Do you want to do that now?
 
M

Matt93

Guest
I'm currently at work so no. I reckon I'll be available in about 3 hours.
Okay, that sounds good! I'm not quite sure how Discord works, but we can try that. If not, then I added you on Skype. Thank you so much. Just let me know when works for you later.
 
Top