Avatar for momo

momo

Member since Dec 2021 • Last active Jan 2022
  • 2 conversations
  • 5 comments

Most recent activity

  • in Bangle.js
    Avatar for momo

    And as I don't want to open another thread but also couldn't find good references: Are there some general tips on how to optimize the performance while programming for the Bangle.js 2? In my game I'm drawing a bunch of shapes - quite rapidly.

  • in Bangle.js
    Avatar for momo

    Hi all, I noticed that under heavy load, the touch event gets fired appropriately, however the xy coordinates are sometimes wrong (to be precise: they are a duplicate of the previous touch event).

    Trying out this code

    Bangle.on('touch', function(button, xy) {
      console.log("coords are", xy);
    });
    
    setInterval(() => {
      g.clear();
      for (let i = 0; i < 40; i ++) {
        g.fillRect(0,0,50,50);
      }
    }, 50);
    

    and then quickly touching the screen, alternating between the upper edge and lower edge, does register the correct amount of events, however a quick top, bottom, top tap results in this console log

    coords are { "x": 103, "y": 9, "type": 0 }
    coords are { "x": 117, "y": 8, "type": 0 }
    coords are { "x": 117, "y": 8, "type": 0 }
    

    It doesn't reproduce every single time, however it happens often. Any idea how this could be fixed?

    Thank you
    ~momo

  • in Bangle.js
    Avatar for momo

    Btw did a little test myself with

    Bangle.on('touch', (button, xy) => {
      console.log("coords are", xy);
    });
    

    and after spamming the touchscreen edges with my finger it looks like

    x ∈ [1,191]
    y ∈ [0,191]

  • in Bangle.js
    Avatar for momo

    Awesome input! @Poolitzer I didn't see your thread, otherwise I would've added it there. It's definitely interesting what @HilmarSt added as well, because 191-8 = 188-5 = 183 (!= 176 but at least the same for both coordinates)

    I think this is best fixed in the underlying system, shall I create a github issue or so? For now I'll hardcode the 8..191 & 5..188 then!

  • in Bangle.js
    Avatar for momo

    Hi all,

    I'm currently working on a smooth snake game for the lovely bangle watch, and with most games, precise controls are key! I'm using the onTouch event to change the Snake's direction, but it felt weird, and then after debugging I found out that the maximum x value I can receive in the onTouch event is not 176 (as you might expect due to the screen resolution) but 191.

    Now I wonder what is the actual resolution of the touchscreen, and is there a function to fetch it dynamically (so I can develop the game device-agnostic)?

    Thank you so much! Happy to join the community!
    ~momo

Actions