R0J0hound's Recent Forum Activity

  • Digging though my capx files I found a couple solutions.

    Here I did wall sliding that works best when the wall angle is 45 degrees from the angle of motion.

    viewtopic.php?f=147&t=91933&p=719471&hilit=event_motion2.capx#p719471

    And here I used SAT in one and used the custom movement behavior in the other to compare. The first is spot on perfect but the moving object is treated as being perfectly round and it only works with rectangular walls.

    viewtopic.php?f=147&t=95108&p=736233&hilit=slide3.capx#p736233

    Hope that helps.

    PS.

    SAT stands for the Separating Axis Theorem and basically gives more info about a collision such as penetration depth and closest direction to resolve the collision.

    EDIT:

    Another idea that is more like steering is to use two detector sprites attached to the moving sprite. Then when they overlap a wall one turns clockwise until it's not overlapping and the other turns counter-clockwise. The just set the angle of motion to whichever detector that turned less.

    https://dl.dropboxusercontent.com/u/542 ... steer.capx

  • One way I handle a situation like that is this:

    find("|1|4|5|6|7|9|11|12|", "|"&var&"|")<>-1[/code:3an99age]
  • I behavior is in the web browser's canvas, so I can't do anything about the issue as it is. The only idea that would work is looping over all the pixels in javascript to have more control, but it will be very slow since it would be done on the cpu instead of the gpu.

    So unless another creative solution is found the fastest way will probably be to use fading sprites.

  • When you preview it will show that, but when you export as nodeWebkit it will show the game path. As far as the path to your capx or project folder I don't think there is an expression for that. My guess is you'd have to type the path in manually when you're previewing and then change it over to the expression when you export.

  • Here is a capx with a few different methods:

    /examples22/cannon.capx

    https://www.dropbox.com/s/f651hqzv53u23 ... .capx?dl=1

    The first method uses a fixed speed and finds an angle. The angle is NaN if there is no solution.

    The second uses a fixed angle and finds a speed. The angle is NaN if there is no solution.

    The third is like the second but the angle is always pointed above the target so there always is a solution.

    Finally the bullet behavior wasn't used since the path isn't accurate when using gravity.

  • NodeWebkit plugin with the NodeWebkit.AppFolder expression.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It only happens when not using webgl, and only then if the browser does anti-aliasing. But no, there currently is no solution to remove it in that situation.

  • 1. "overlaps at offset" just moves the object, checks for collision then moves back. I've done your request before in events by resizing the object, checking for collision, then setting the size back to what it was. I do see how it would be tied in to request 2 since you would want to know the center to scale from.

    2. Would moving the hotspot leave the xy positions the same or would it also change the positions so the object would stay visually unmoved?

  • 1. Look at the AJAX object for a way to download files from websites. I hear you can get more complicated communication if you make the website with PHP, but that's outside the scope of what I'm interested in.

    2. You can either convert the text to an array with a for loop and using tokenat() and tokencount() kind of like in my capx, or you can directly add the commands to the array with the push action, one word at a time. After it's all in an array, you can use the array.asJSON expression to get a text representation of the array. In fact you can save a file with that to your website and use the array's download action and bypass the ajax object.

    3. My capx was a simple example case of this. You'll have to add events to handle every function you want to use.

    Overall the process to make an interpreter is much like doing it in any other programming language. It can get as advanced and complicated as you like.

  • It has a draw texture quad action that can do it. All you need to provide are the positions of the four corners and a object to get the texture from.

    There is an example of it here:

  • Hmm... It's still completely invisible for me in the first pic. Either way there isn't anything I can do about it in the plugin. One idea you could try is to start with the canvas completely white, aka not transparent at all...

    Just tested that and it doesn't work. If finally was able to see it by tilting my screen. I think it's caused by number rounding when the colors blend. A solution that works is to use an additive blend instead.

    https://dl.dropboxusercontent.com/u/542 ... itive.capx

  • Well to spawn on the edge of the layout you can do it with two events:

    system compare choose(0,1) = 0
    --- create object at random(LayoutWidth), choose(0, LayoutHeight)
    else
    ---create object at choose(0, LayoutWidth), random(LayoutHeight)[/code:3rlso663]
    
    You can then modify that to spawn further away from the edge (say 100 pixels) with:
    [code:3rlso663]system compare choose(0,1) = 0
    --- create object at random(-100, LayoutWidth+100), choose(-100, LayoutHeight+100)
    else
    ---create object at choose(-100, LayoutWidth+100), random(-100, LayoutHeight+100)[/code:3rlso663]
    
    Both those however only spawn along the edge of a rectangle.  To spawn in a random area outside the layout you can break up the areas outside into four rectangles in which you can create objects in the same way as inside the layout.  Keep in mind you need to define how big an area to spawn in.
    
    For example the whole area outside the layout up to 100 pixels away:
    [code:3rlso663]
    global number region=0
    every tick
    --- set region to choose(0,1,2,3)
    region = 0
    --- create object at random(-100, LayoutWidth), random(-100, 0)
    region = 1
    ---create object at random(100)+LayoutWidth, random(-100, LayoutHeight)
    region = 2
    --- create object at random(0, LayoutWidth+100), random(100)+ LayoutHeight
    region = 3
    --- create object at random(-100, 0), random(0, LayoutHeight+100)
    [/code:3rlso663]
    
    The formulas should be correct, but I haven't tested it.
    -cheers