Avatar for joyrider3774

joyrider3774

Member since Sep 2023 • Last active Oct 2023
  • 4 conversations
  • 29 comments

Most recent activity

  • in Bangle.js
    Avatar for joyrider3774

    ok, why did prefer the touch areas over up/down/left/right swipes?

    The game uses a selector which you need to move to the a pipe which you want to rotate or to move over an arrow on sides in case of slide mode. If you need to move the selector 3 times left and 4 times down before reaching the waterpipe you want todo your action on it can be done much quicker by quickly touching the screen 3 times near left edge and then 4 times near bottom edge than when having to swipe 3 times left then swipe 4 times down its faster and feels more natural to me than swiping. Also with swiping you obscure in a lot of case the complete playfield on your screen with your finger, while touching on the sides you can still see a bit of the middle. Touching just feels more natural than swiping to me, i did not want to constantly swipe on the screen to move the selector

  • in Bangle.js
    Avatar for joyrider3774

    I have not been very sucessful at solving even on a very easy one setting.

    try rotate mode, thats very easy, the other modes involving sliding are really hard as it requires you to visualize how the water pipes would end up after your move.

    Not sure what OPEN/MUS means on the display ?

    Open is displayed in the level selector, before you start a game you are in the level selector. By default only the very first level (of 25) is unlocked (open) in any game difficulty (except random). When you are in level selector you can touch on the left or right side of the screen to select the level and there you'll see the open message or locked message if the level is not unlocked yet (and you can not play it then). MUS is actually MVS shorthand for MOVES it just shows you how many slides and rotates you had done.

    The touch areas's are quite narrow. You have to be very careful to ensure you are always at
    the edge to make sure the selected movement occurs.

    yeah they are indeed, but if i make them bigger there is more place for error on touching in the middle for the extra button simulation. On the watch i just press the sides of the screen and works ok.

    Very ingenious game. Is the design yours or is this a copy of a classic game ?

    No i did not invent the game concept, it is based on the Net and Netslide game from the Simon Tatham's Portable Puzzle Collection, but all the code is my own re-implementation of these two game concepts mixed into one game

  • in Projects
    Avatar for joyrider3774

    Just to let people know that the game is as good as finished, i just need to test it a bit more. I will do a pull request soon against the main repo, but in the mean time you can already get a development build from my github
    or you can test and view the code inside the the emulator (note: viewing options might not work inside the emulator as the rubido.settings.js file will not exist, unless you upload it to storage as well using the emulator

  • in Projects
    Avatar for joyrider3774

    Hi gordon,

    Thats a left over from when having the function compile C Code.

    If i used the boardpart variable it did not work with compiled C code, it somehow gotten integer numbers back instead of the objects, but if i always referenced it using BoardParts.Items[Y][X] the compiled c code worked fine. Initially i had it using the boardPart variable but that no longer worked when compiled to C code.

    The current (new iter) implementation also no longer works when compiled to C Code so i just removed the "compiled" flag but i can indeed use boardPart again now.

    Will change it back thanks.

  • in Projects
    Avatar for joyrider3774

    Hey gordon,

    I managed to implement the background counting of movesleft. I've used the setinterval function todo this. And now we can keep on playing immediatly after a move was done and it will update the movesleft value once it has done calculating them. I just call the GameLoop one more time to verify if it is a winning game and draw the results basically my code looks like this now :

    //procedure that starts the movesLeftIter function using an interval to loop over
    //all pegs
    function movesLeft() {
     if(movesLeftTimer)
        clearInterval(movesLeftTimer);
      movesLeftCount = 0;
      pegsLeft = 0;
      movesLeftX = 0;
      movesLeftY = 0;
      movesLeftTimer = setInterval(movesLeftIter, 0);
    }
    
    // procedure that calculates how many moves are possible in the current board state for 1 Peg
    // we can simply do this by checking all parts and see if they can move to all directions
    // the canmoveto method in CPegs is does all the checking
    function movesLeftIter() {
      //print (BoardParts.Items[Y][X]);
      // if there is a boardpart on that X,Y Coordinate
      // check all direction if we can move to that if so increases the movesleft
      if (BoardParts.Items[movesLeftY][movesLeftX­]) {
        if (BoardParts.Items[movesLeftY][movesLeftX­].AnimPhase < 2) {
          pegsLeft++;
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX + 2, movesLeftY, false);
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX - 2, movesLeftY, false);
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX, movesLeftY - 2, false);
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX, movesLeftY + 2, false);
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX + 2, movesLeftY - 2, false);
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX + 2, movesLeftY + 2, false);
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX - 2, movesLeftY + 2, false);
          movesLeftCount += CPeg_CanMoveTo(BoardParts.Items[movesLef­tY][movesLeftX], movesLeftX - 2, movesLeftY - 2, false);
        }
      }
      movesLeftX++;
      if(movesLeftX == NROFCOLS)
      {
        movesLeftY++;
        if((movesLeftY == NROFROWS) && (movesLeftX == NROFCOLS))
        {
          clearInterval(movesLeftTimer);
          prevMovesLeftCount = movesLeftCount;
          prevPegsLeft = pegsLeft;
          if(GameState == GSGAME)
            loop();
          return;
        }
        movesLeftX = 0;
      }
    }
    

    and that seems to work fine

  • in Projects
    Avatar for joyrider3774

    This looks great! It'd be good to see this in the app loader!

    Yes that's my aim, but i'm still working on it, i need to still add some options to make the input rects visible and make theming optional.

    Do you think you could come up with a small self-contained example bit of code that you could post up here that runs really slow like you mentioned? It might be we can find a way to make it faster.

    I'll have to check but it may not be easy to do this as i used classes and such that are intertwined with the checks

    What do you mean by "Moves Left" - does it actually try and run through each move each time to see how many would be needed to finish?

    Yes, after each "move" you have done, the game loops through all still available pegs using a double for loop (i have a two dimensional array to represent the playfield). And i have a Peg class which contains a canMoveToPostion function that will check if a certain Peg can move to a postion and return true or false. For each peg it then calls this functions with all possible move location per peg, these are 4 or 8 calls (moves) to that function depending on the difficulty (if diagonals are allowed). It has todo this for each peg on the board and then it will display value, but it also uses that value to determine if the game is over (moves left = 0, like no peg can move anywhere anymore)

    this is the current code:

    function movesLeft() {
      "compiled";
      let result = 0;
      pegsLeft = 0;
      let BoardPart;
      let Y, X;
      for (Y = 0; Y < NROFROWS; Y++) {
        for (X = 0; X < NROFCOLS; X++) {
          BoardPart = BoardParts.Items[Y][X];
          //print (BoardParts.Items[Y][X]);
          // if there is a boardpart on that X,Y Coordinate
          // check all direction if we can move to that if so increases the movesleft
          if (BoardParts.Items[Y][X]) {
            if (BoardParts.Items[Y][X].AnimPhase < 2) {
              pegsLeft++;
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X + 2, Y, false);
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X - 2, Y, false);
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X, Y - 2, false);
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X, Y + 2, false);
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X + 2, Y - 2, false);
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X + 2, Y + 2, false);
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X - 2, Y + 2, false);
              result += CPeg_CanMoveTo(BoardParts.Items[Y][X], X - 2, Y - 2, false);
            }
          }
        }
      }
      return result;
    }
    

    Just a thought but even without using compiled code, if you could split the code up such that it could run as a function that gets called multiple times, you could update the screen immediately, and then run the calculation in the background. If the user interacted with the Bangle to make another move you could just cancel, redraw with the new state and start again.

    thats not a bad idea, but i'm not sure how easily i can adapt to this, you see i do a single frame game loop and everything gets done during that single frame as soon as thats over the game is idling, i don't have a loop that keeps getting called. If nothing needs drawing it doesn't do anything at all but i could give it a try by recalling the game loop if the calculation had not finished but i'll need to check how i can actually do this. When you say run the calculation in the background do you refer to something like threads or so ? Is that some special functionality in javascript / bangle ?

  • in Projects
    Avatar for joyrider3774

    I'm working on version 0.02. It will have bigger playfield tiles and repositioned screen layout so that things are more viewable on the watch itself. The menu's (atm) will remain the same as well as the little ingame help but during gameplay the playfield will actually be a lot bigger, i went from 10x10 tiles to 16x16 tiles and it makes viewing it on the watch a lot better.
    If you can't wait for the release there is a dev version available on my github pages

    and here is a small gif to show what i mean

Actions