R0J0hound's Forum Posts

  • They can be anywhere, it doesn't affect performance at all. In other programming language the same applies, but generally the function is defined before it is used. In some languages it doesn't have to though, the compiler can find the function fine even if it's put below the place it's called.

  • The search terms to use are "color profile" or "color management" or "icc". It's something to have images display consistency across monitors, it's managed by windows with it's program "color management".

    Anyway searching the above term with "chrome" give loads of relevant pages. Here's two:

    http://www.dpreview.com/forums/thread/3738355

    http://www.marcelpatek.com/blog/2011/11 ... le-chrome/

    Anyways the color changes due to a color profile, I don't know if one is using it or not though.

  • I can't open the capx right now but maybe it's because you use int() instead of float() so the result is being rounded?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Why would you want to do it without angle() or atan()? Internally angle() uses atan anyway.

    You could use an infinite power series to calculate atan() in radians without using atan.

    Or another method is to use an array to lookup angles from tangent ratios, and using interpolation for the in between values. However this is only as precise as how many values are in the array, not to mention you'd need to populate the array beforehand.

  • Calculating the midpoint is fairly straightforward. It's just a matter of finding the enclosing bounding box:

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

  • RBuster

    There's a "draw box" and "draw circle" action that can do that.

    To erase you have to clear everything with the "clear canvas" action and re-draw everything else. Another idea is to draw over the thing last drawn with white or whatever the background color was. I guess for either you need to come up with a way to keep track of what was drawn.

    It's much like mspaint in that once something is drawn it's just pixels.

  • I don't follow the size issue. It works the same for me if the player is any size.

    The second one always handles the player as a circle, size is irrelevant but you do need to change the radius value i think.

    I have no comparison on which is slower. They do slightly different things.

  • Badmiracle

    Usually if both objects have the behavior, the knock back is automatic. Or if you want it to be more severe you could apply an impulse on post collide. If one object doesn't have the behavior you can still apply an impulse.

  • My isometric behavior is only useful if you're using 2:1 isometric and want to sort blocks of any dimension in any location. They also have to be oriented the same. In sort it uses an algorithm that addresses cases that aren't easily sortable. While it also provides some helpers for the collisions and motion those can be done in many other ways.

    If you're doing everything on a ground plane or on a grid then the behavior is overkill and newt's suggestion is better suited.

  • To do that you have to manually handle collisions and how the sprite responds. In other words you can't use the solid behavior.

    You can look here for a way to do wall sliding:

  • If the layer is invisible it won't affect rendering performance at all.

  • The xml plugin only reads xml, it doesn't write.

    To write you'll need to either make your own writer or try to utilize some javascript library to do it.

    You can look here for the xml file format:

    https://en.wikipedia.org/wiki/XML

    So basically the best way to append data to an xml file is to load it with ajax or with nwjs, store it in a variable, then just add text to the end.

    As an example, if you have a file called "animal.xml" added to your project you can load it, append data to it, and finally download it with this:

    start of layout

    --- ajax: request animal.xml

    global text xml=""

    ajax: on loaded

    --- set xml to ajax.lastdata

    --- add "<fish>tuna</fish>" to xml

    --- browser: invoke download of xml

  • Each instance has it's own texture, whereas sprites share the same texture. It just depends on what you want to do.

  • Not really, the purpose of the paster object is to have something you can draw to. I guess you could use paster instances instead of sprites.

  • The animation frames of a sprite are shared between all the instances, so if you replace one they all change. You could just use paster instances instead of sprites i guess.