jobel's Recent Forum Activity

  • newt LOS would be interesting to try, you'd have to create obstacles though and still it seems like you need a "ruleset".

  • oosyrag haha, that's funny because I kept working on it as well.

    I ended up leveraging your Overlapping at Offset and made a "ruleset" with a priority.

    When hitting UP ARROW one space up is top priority, 2 spaces up next etc.. 3rd priority it doesn't matter you can check right or left first. I'm not entirely sure it works as expected. At first I had immediate right/left the 2nd priority and sometimes I would get stuck and not be able to get to a piece. That seems to have been fixed by giving two spaces away 2nd priority. but still needs more testing!

    I only check 9 spaces since there should never bee that many empty spaces - but it makes it limited since you can't leverage the code for a bigger board or less pieces.

    here's the code..really long and not very efficient.. there's probably a more stream line way of doing it!

    drive.google.com/file/d/1xr1b8XgVFO22Y-mVgXyaHmmBciuBQjQh/view

  • can you mock up a simplified version in a separate capx what you trying to do?

    you should be able to save any data you want to an array.

  • oosyrag it's all moot anyhow since I don't think I am going this direction anymore, it's not really worth it - and I'm sure there are scenarios I haven't thought of yet. But thanks for you your help on this! I very much appreciate it.

  • oosyrag either F5 or F7 would be okay looking. but that's what I'm saying the rules are somewhat complex.

    if you started at B4 and pressed RIGHT, if there is no piece immediately to the right, then you would search outward in a radius from there for the next closest piece.

    You would not want to move all the way to G4 instead you'd probably want to go to D3

    EDIT: actually not a radius since you wouldn't want to go up to B3...maybe a half radius?

  • oosyrag I've also never used Stop Loop, will that break out of a sub event?

    i.e. where do I put code that never passed and executed the stop loop so I know to check the next column?

    however it does seem like it could get complex if I had something like this:

    if I had G6 selected and hit LEFT ARROW I'd want to pop to D4. you'd have to write code that kept checking columns.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • oosyrag oh that's really cool.. I've never used Overlap at Offset.. I like that approach thanks!

  • oosyrag oh I didn't mean lots of checks as in performance issue.. I just meant writing complex code in Construct Event script.

    yeah I might be over thinking it.. having the player just navigating to an empty grid tile might be okay looking... I think popping right to the " filled piece" might be more work than it's worth.

  • oosyrag

    If you run into a filled grid object, stop loop and move the selection to that object. Otherwise, if no valid spots were encountered, nothing happens.

    yeah that way is the "lots of checks" I was originally thinking. but it gets even more complicated in the case where nothing happens. You'd always want something to happen, so if there were only 1 in a particular column and you hit UP, you'd want to go the nearest up piece to the left or right.

  • newt the problem is if it looks like this:

    X_X_X
    X_X__
    X_X__
    ____O
    
    

    if you were selected on the O and hit UP you'd want to go all the way to the top X in that column.

    but in this case:

    X_X__ 
    X_X__
    X_X__
    ____O
    
    

    UP would go to the bottom right X

    EDIT nevermind.. this stupid website is so horrible you can't make fixed width text.. pain in the ass..

  • Hi,

    does anyone have any clear ideas on how to use the arrow keys to select from a randomly generated grid?

    I haven't attempted it yet, but here is the version where I select each cell of the grid - now I just want to be able to hop over the pieces that aren't there.

    It seems really difficult with lots of checks, but I'm wondering if there is a simpler way. Maybe with an array or figuring out the distance.. I know the arrow keys aren't a great nav tool, but I'm thinking of using the D-pad on a game controller so its the same.

    I really want it to snap to each piece. I was thinking of potentially getting the nearest sprite in the angle that was keyed maybe?

    Any suggestions?

    drive.google.com/file/d/1oysENRrUf7cTN8dmKZsRirEFhTOmDMbM/view

    Tagged:

  • R0J0hound

    demoman.net

    wow.. thanks, that's a really cool interactive demo!

jobel's avatar

jobel

Member since 27 Jul, 2013

Twitter
jobel has 8 followers

Connect with jobel

Trophy Case

  • 11-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x4
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

18/44
How to earn trophies