R0J0hound's Recent Forum Activity

  • You’d have to implement your own on value changed scheme. Maybe store the old values in a separate array.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • So slower?

    Apart from changing between text,spritefont or html element to draw text ( they all work the same with a set text action), you could use js instead of events to update the text. Or maybe use multiple instances vs one big one.

    That’s mostly what you have control over in construct.

    In general JavaScript will be much faster than events if you don’t mind using it. Personally I don’t mind using js but I find it very unpleasant using js within construct.

  • The event system has nothing to do with JavaScript. That’s just what it’s implemented in and actually events do not have a direct correspondence with js.

    If it helps being able to use ors between groups of and’d events has been suggested at least a few times before.

    I think one roadblock is that conditions aren’t just logical, they also deal with picking which leads to some quirky situations.

    Anyways you can largely do what you want to do is just with the system compare or evaluate condition and the and/or expressions (“&”,”|”). But that mostly depends on there being a single instances of the objects you’re comparing and if there’s an expression equivalent to the conditions.

  • I second the idea to use spritefont instead of the text object. Or you could even try setting the text of an html element.

    If rendering all the text is still what’s making it slow you could make the memory view scrollable and only draw on screen text.

    If the rendering isn’t the bottleneck then you could try doing the update over multiple ticks to spread the load. There is an overhead with events over doing it in straight js but it varies. Generally it doesn’t matter but even a small overhead adds up when you do a lot at once.

  • How are you placing the cubes?

    If you are placing the cubes from isometric coordinates (ix,iy,iz) the diagonal would just be iy.

    As an example here is the math to project an isometric position (ix,iy,iz) to the screen (x,y):

    X=ix-iy

    Y=(ix+iy)/2-iz

    If instead you only have the xy positions of the cubes you can reverse the formulas above to get the iso position. But the iz value can be anything per cube.

    ix=y+x/2+iz

    iy=Y-x/2+iz

    Possibly you can look at the zorder and relative position of overlapping cubes to calculate the iso position too. But you’ll often have ambiguous solutions. For example if there isn’t a cube at the center intersection then it out guess four iy layers instead of three.

  • Typo on my part. It should be mid(a,loopindex,1). I wrote i instead of 1

  • One way could be to find individual letters in the first string in the second. Anytime a letter is found you’d remove that letter from the second. It would mess up the second string so you’d want to copy it first. Should be pretty doable in a function:

    function findMatches(a, b)
    -- var match=""
    -- var letter=""
    -- var i=0
    -- repeat len(a) times
    -- -- set letter to mid(a,loopindex,i)
    -- -- set i to find(b, letter)
    -- -- compare: i>-1
    -- -- -- add letter to match
    -- -- -- set b to left(b,i)&right(b, len(b)-1-i)
    -- -- -- set return value to match
  • Had another go at it so now the logic is a bit more understandable and fits within 25 events.

    When you click on a tile it does a search for valid moves from that tile to other matching tiles. the path from one tile to another can only bend twice and the path has to go through an empty space first.

    Then when you click on a matching tile it destroys the tiles and draws the path.

    If you want to see the pathfinding in action make the marker sprite initially visible in the editor.

    It's trivial to change the number of unique tiles, but just be sure there are enough tiles on the board so there can be pairs.

    dropbox.com/scl/fi/gpd6ss46cm1a7vfb469ev/onet2.capx

  • Is it the same thing?

    That example was after me plating an Onet game just long enough to infer some rules. Best I could tell matches consisted of adjacent tiles or tiles connected with a path with at most two bends. There are probably simpler and more understandable ways to do it.

    I know the common way to make games now a days is to find a tutorial or find/buy a template. But usually you can get pretty far just by making a list of the rules of a game and figuring out how to do each of those.

  • Are you using the latest version of C3 on windows? I’ve had c3p files fail to load in older versions of c3 if they were saved in newer versions. It helpfully points out that the file was saved in a newer version or just gives that error. Even reloading c3 sometimes fixes it.

  • There’s nothing in that file.

    All a ray cast does is check for collision between two points. Quick test works fine.

  • Are you specifying what objects are an obstacle for the Los behavior?

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 155 followers

Connect with R0J0hound