R0J0hound's Recent Forum Activity

  • Having an array as a primitive variable type instead of a separate object would be nice. It would make things more readable. As is picking and functions can make it look complicated and/or make things more complicated. Don’t get me wrong, picking is pretty nifty for many things but is an awkward replacement for some logic.

  • Buttons are added to the webpage with JavaScript, they aren’t added to the exported html file.

    It looks like those snippets of html just runs some JavaScript when a button is clicked. Perhaps you can utilize the browser execjs action to run the Javascript in those snippets. At least that’s my impression. I don’t use social media so I haven’t concerned myself with how it works.

  • My guess is it would be random. Dictionaries in most languages are.

    You can confirm this by reading about JavaScript dictionaries. Depending on the implementation they could be ordered by when they were added.

    If you want it ordered you could add add the keys to an array, sort that, and loop over that.

  • 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.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

R0J0hound's avatar

R0J0hound

Member since 15 Jun, 2009

Twitter
R0J0hound has 157 followers

Connect with R0J0hound