R0J0hound's Recent Forum Activity

  • You’re doing something like

    Land.x<-200

    —- destroy land

    —- create land at (200, 400)

    The gap will vary as dot varies.

    A more robust way would be to pick the rightmost land and create the new one to the right of it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • To get around the layout limit of 1 million you could make the objects smaller and increase the layout scale or zoom ( i forget what it's called). The image sizes would be the same as if they weren't scaled down so it will look visually identical.

    As far as if a level that big is possible. I'd say so, but you'd have to actually try it and see how it goes.

  • Effects let you change the paremeters on the fly, and turned on or off on the fly, whereas an image is fixed. Also it’s simple to see that just drawing a sprite is faster than drawing a sprite with an effect since less is being done. The actual performance difference could be negligible. You’d have to test and see.

  • The bounding box is the area c2 uses for the effect. It does that as an optimization. The reason the outline of the box could be it’s sampling pixels outside that, which this effect does. Maybe it’s undefined behavior or maybe it’s something that can be handled. If it is it would be in the c2 renderer and not in shader.

    The reason it draws darker or only happens when transparent could be multiple reasons. One, perhaps doing an outline only works when no transparent and the opacity should be applied later? This is something that maybe can be addressed at the runtime level? I could be wrong there since I have minimal understanding how effects and the c2 renderer work together.

    You could perhaps work around the issues in this shader by utilizing the paster plugin to get more control of the rendering pipeline. This may not be feasible if the effect doesn’t draw right, since there are issues drawing effects with it. I haven’t tested it, but I digress.

    Basically you make the objects not transparent and paste them to a paster object with the outline effect. Then you make the paster object semitransparent and paste that to another main paster... it sounds more complicated than it is.

    The object is to have everything invisible and instead just draw to the paster.

    So the solution is to either:

    1. Fix the shader. No idea what a fix would be.

    2. Use the paster object to do the rendering in a more manual controlled way. It may be tedious.

    3. Modify the renderer? Least feasible of all. No idea what you’d change here if anything. Probably doing some investigations with straight webgl and shaders in straight JavaScript would be enlightening. Maybe a solution would be clearer after that.

    Anyways cheers

    Edit:

    It occurred to me that you could try increasing the bounding box size (there’s a setting in the shader xml), then in the shader itself skip when processing pixels around the edge. It should be doable I think by dealing with the uv cords. I feel like I have to re-figure out how they work in shaders every time I use them so I’ll pass.

  • You're talking about a layout in an exported game? It is in an obscure form so that it both takes up less space and isn't readable by anything but the runtime. It would open a can of worms if we reverse engineered the export to make that possible. There are probably better solutions than doing that

    Anyways, if you created both games you could make your own level loader. Basically take a level and output all the object locations and any other stuff relevant to your game to a text file. Then make a parser that reads that said text file and recreates all the objects again.

  • You can do it with events. The custom movement behavior doesn't add much other than longer expressions.

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

    You can get to run exactly like the video by tweaking the

    max speed

    acceleration

    and turning speed

    Also once your game loaded I see you have the spaceship slowdown over time.

    You can do that by doing this every tick:

    set vx to self.vx*0.95

    set vy to self.vy*0.95

    an alternative is applying an acceleration opposite the angle of motion and proportionate to the speed:

    set vx to self.vx*(1-damping*dt)

    set vy to self.vy*(1-damping*dt)

    where "damping" is something from 0 to about 60. If you use too high of a value it will make things accelerate uncontrollably.

  • You can do your own sort with events. For example here is a bubble sort:

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

  • You can do it with Javascript with a image in the files folder of your project.

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

    There is one change needed to use in c3.

    If you want to load from a sprite image, or you don't want to mess with javascript, then you'll have to get someone to make a plugin.

  • For perfect values you could use integers an just divide by 10 as the last step.

    so instead if

    var = 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1 + 0.1

    do

    var = 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1 + 1

    then whenever you want to use var use var/10.

    As to why the decimal version doesn't work is 0.1 can't be perfectly represented in binary. So when adding multiple values together the approximations add up to be more severe. But yeah, rounding like dop says should work.

  • dop2000

    You can specify the font, i don't know if web fonts have any special handling besides that.

  • You could do a star field with the achievement text zooming in. Frustratingly enough setting the size of the text object changes the text area and not the visual scale. I could change the font size dynamically but that probably is inefficient methinks. So I just used a bit of javascript to generate an image with the text and load that into a sprite.

    https://www.dropbox.com/s/xaubosnch3ls6 ... .capx?dl=0

    Another idea is to have the text scale as if the lines were being scaled on a cylinder.

    The star wars marquee should be doable with a shader i think. It's just a perspective transform. You could also scale them like that as well.

  • Use c2_callFunction is to call a C2 function from javascript

    Use Browser.execJs() to call a javascript function from c2. It just calls the javascript eval() function.

    1. Typically in a plugin, but you can put it anywhere you like.

    2. Just like in the manual. If the C2 function you want to call is named "foo", you'd call it with c2_callFunction("foo", []);

    3. Use the "set return value" in the "foo" function.

    You probably just want to use the Browser object to call javascript if i understand you correctly.

    Set variable_a to Browser.ExecJS(variable_a&"*2")