bitwise

  1. mbeytekin

    Bitwise AND operator in shaders

    How can I calculate this in GM2 fragment shader; m[(k+4)&7] += vec4(c1 * wk, wk); s[(k+4)&7] += cc1 * wk; (k+4)&7 gives a syntax error in GM2.. I found this code from shadertoy and it works there... https://www.shadertoy.com/view/ltyyDd
  2. zendraw

    SOLVED bitwise checks

    so i want to have if (var1 && var2 && var3) but like if (varall1 & varall2) the problem is with var & var it ends the moment 1 part of the value is equal to the other, but i want it to check if varall2 covers all values of varall1 so if (3 & 6) {do stuff}; 6 covers all bits of 3, but it checks...
  3. Erayd

    GMS 2 Binary List Depth Ordering Issue

    I've been working on following this concept on binary lists as depth ordering: https://forum.yoyogames.com/index.php?threads/depth-ordering-in-gms2-priority-list-nested-list-grid-binary-list.13425/ I dived in to bitwise operators and read through several demo scripts by yoyo along with reading...
  4. NeZvers

    GML Movement fraction for next step

    I'm puzzled for some time how to solve this. For the beginning, I'm using bitwise calculation as a challenge, but it's easily translatable to the traditional calculation (I'll provide explanation just in case). /* hspd[0] used for main speed hspd[1] used to carry over the fraction RUN speed is...
  5. NeZvers

    GML ds_grid collision slopes [SOLVED]

    As a material for tutorials, I wanted to give a challenge for myself and make a platformer with the bitwise calculation (no floats) and ds_grid. I want to avoid any loop and achieve it only with if. Regular block collision work like charm, but I wanted to push it further with slopes and moving...
  6. NeZvers

    GML Grid collision system with slopes (keep ignoring)

    EDIT: Thanks for help!
  7. S

    GMS 2 Bitwise operations and Ds_Grids

    Evening all, I am converting a 2d array to a ds_grid but I am not sure how to convert the bitwise operations. Do we have to do something specific to use bitwise operations with ds_grid? I have gone from oControllerTile.tileArray[_arrayHeight, _arrayLength] |= ISBLOCKINGMOVEMENT |...
  8. Blaize

    GMS 2 [SOLVED] Bitwise Setting and Clearing flags

    Hi guys, So I've just started getting into using bitwise operations and I'm just experimenting with a grid-based movement system. There are a few things I want to clear up: 1. Defining the bits - I've got them set as macros: 2. Setting flags in the play area Following the bits, these are the...
  9. Shadowblitz16

    GMS 2 Setting and getting binary bits and collision

    can someone explain to me how to set and read binary bits? I need separate explanation on how to set and get them one at a time, and all together. I also need to understand how to set and get them from the right bits. I have been trying to set multiple bits by doing.. var _flag = (_top_left |...
  10. mrdaneeyul

    Help understanding bitwise tile collision for 16px tiles

    Hey everyone! So I've made several attempts at understanding the complex world of bitwise operations so I can get tile collisions all figured out, and this time I figured I'd just ask! I've read up on the new articles in the GMS2 manual, done lots of research prior, and looked through the demos...
  11. P

    Legacy GM Bitwise operations and their uses

    GM Version: Studio and up Target Platform: All Download: N/A Links: The documentation on bitwise operations Summary: An in depth tutorial to teach you how to use binary operators to your benefit for beginners. Tutorial: First of all, I created a tool to let you easily test bitwise operations...
Top