• 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!

Looking for the meaning inside code (Yoyo Brick Breaker Demo)

D

dannyyplau

Guest
I am new for the GML. I have tried to read the code in Yoyo Brick Breaker Demo.

I have see this code in the script "ClearBlock":

...
var count = global.hits[# argument0>>5,argument1>>4]-1;
...

I have no idea what happened if it use shift operator (>>) for argument0 and argument1,
And the # symbol, I have tried to search its meaning in help file but cannot find.

May someone know and kindly advise? Thank you.
 

YellowAfterlife

ᴏɴʟɪɴᴇ ᴍᴜʟᴛɪᴘʟᴀʏᴇʀ
Forum Staff
Moderator
a[#b, c] is shorthand for ds_grid_get(a, b, c)

(a >> b) is roughly the same as floor(a / power(2, b)) - so, in this case, it divides coordinates by 32 and 16 accordingly. A bit faster, but in most games you don't have to worry about such small details.
 
Top