R0J0hound's Forum Posts

  • Prominent

    Feel free to go for it. All my plugins/behaviors, unless I explicitly specify otherwise, can be used in games that are sold.

    In regard to the template, You could even include the plugin with it, although it would likely be better to just refer them to the plugin topic. The only requirement is I should be credited for making it.

    Basically the use is very liberal. Do anything you like with it, even modify it, just don't claim to have originally created it.

  • This topic may be of use:

    Chrome uses a color profile to adjust the colors. Or something like that.

  • I'm not sure I follow. In your example the sprite with the blend mode is on layer 0 and is covered by the objects on the other layers.

    In general a blend mode will effect everything drawn before it, or if the layer has "force own texture" then it will only affect what's already drawn on that layer.

    More complicated setups such as objects on one layer only blending with objects on other isn't possible with vanilla C2. You can use the paster object to do any complicated setup though. Just think of each paster as a layer and selectively draw stuff to it.

  • Except you can't access the same stuff you can from C2's expressions.

  • The limitation of the creature2d plugin has to do with the limits of what plugins can do in C2's editor. At runtime all the features could be used, although it takes someone interested enough to do it. Also webgl is needed for the deformations to display quickly.

    Anyway a plugin for this runtime would have the same limitations. I also stand by my original statement about the ease of making the plugin, since it's js runtime is abstracted in a complicated way that isn't directly usable like the creature2d one is.

  • To modify the source code you'll have to find where it clears. This usually means following out functions in the source. Typically it all starts in main(). This can time consuming to do but you get faster at it. Then to compile it you need Visual Studio 2008, and the directX runtime, but that is usually where people give up. Using a different version of Visual Studio has incompatibilities that would have to be changed.

    Back to your original question though you can do it with a canvas and the paste action. Basically every frame paste all the objects you want to draw. There may be features that make it easier but I don't mess with Construct Classic any more so I don't know them.

  • I don't have an example, sorry. That was just an idea. I guess you could paste a layer too.

    It's been a while since I've used cc.

  • You can't disable clearing without modifying the source code I suppose.

    Another idea is to utilize the "grab layout" (or whatever it was called) property of the canvas object. At least as I recall that's the closest feature I can think of. I'm going off memory though.

  • Prominent

    That one is intentional, well, it's just doing exactly what the html5 canvas does internally. The origin of all the drawing functions is the top/left of the canvas. The layout coordinates only match canvas coordinates when the canvas is unrotated and has it's top left at the top left of the layout.

    The only exceptions are the paste functions.

  • I guess it would probably be haelpful to expalin the formula.

    Here's a general view for one corner. P1 is the current corner and P0,P2 are the previous and next corners. "A" is the location of the player.

       A
      /
     /
    P1----P2
    |     |
    |     |
    |     |
    P0----+
    
    So next I made the obsevation that the current point (A) would only need to be created if it's in either of these two regions (b or c).
    
         .........
         .........
         bbbbbbb..
         bbbbbbb..
         bbbbbbb..
    ..cccP1---+
    ..ccc|    |
    ..ccc|    |
    ..ccc+----+
    ..ccc
    .....
    .....
    
    To calculate which region I used a vector dot product to calculate a vector projection.  That sounds more vague than it is but it looks like this. It works relative to any corner.
    
    (A-P1) dot (P0-P1) < 0 and 
    (A-P1) dot (P2-P1) > 0
    or
    (A-P1) dot (P2-P1) < 0 and
    (A-P1) dot (P1-P1) > 0
    [/code:2mpj4t2g]
    The rest was a lot of math simplification.
  • One slightly different way would be to get the angle from each imagepoint to the player and subtract from that the angle to the next imagepoint.

    Or in the simple case of a square and the imagepoints are layed out in this order:

    41

    32

    It simplifies to:

    set a to angle(Target.ImagePointX(loopindex+1),Target.ImagePointY(loopindex+1),Sprite.X,Sprite.Y) -90*loopindex

    Then if the following is true for any imagepoint you can create it.

    (-sin(a)<0 & cos(a)>0) | (cos(a)<0 & -sin(a)>0)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I fiddled with this earlier. C2's runtime actually uses localStorage to store the saves. I had no luck figuring out how to access it from either JavaScript with execjs or with the local storage plugin itself. I may have missed something though.

  • It's not that it can't be changed. It can be changed to store speed and angle of motion instead of xvelocity and yvelocity. The only other tweak would be when gravity is applied it would have to switch to x and y velocity for the calculation since it changes both speed and angle of motion.

    The real issue is this is a breaking change, the affects the behavior's behavior and can change how existing projects work. Personally i'd like it changed but then again I don't have commercial projects relying on the previous behavior.

  • It was reported before a few times. The crux of the issue is speed is stored as X and y components, and the speed and angle of motion are calculated from that. So when the speed is zero both components are zero and the angle of motion is calculated as zero.

  • Try it and see.