R0J0hound's Recent Forum Activity

  • Barye you wouldn't happen to be using the "OR" condition would you? It is known to cause crashes when changing layouts in CC.

  • miketolsa

    There is no documentation written, although the official documentation can be referenced for some info since a lot of it is the same. There are a lot of little documentation tidbits in the descriptions when adding conditions, actions, and expressions.

    You'd have to try it and see if it performs better. I haven't used any mobile exports at all.

  • You mean heavy on cpu usage? Test it and see how heavy it is. Setting the force is basically just setting a number and has a negligible performance impact.

  • It's possible in theory, but in practice it would be hard to get it to the point where it works the same as it does in javascript and html5. Not to mention it would be hard to update it to stay on par with c2 releases.

    Now if you utilized a javascript engine like v8 or spidermonkey you can get most of the way there with most of c2's runtime running as is you just need to impliment html5 stuff like images,canvases, input, etc in c++ or something.

    I was able to do that with a couple hundred lines of Python with v8 and sfml as the input/graphics backend. It just runs an html5 export to do it. I've been meaning to covert it over to c++ to eliminate the overhead of Python. But anyway the idea is to just impliment the system specific stuff in c++ and run everything else with js.

  • For that you could use Bresenham's line algorithm for a nice result. But it isn't simple.

    You could use lerp to do it like this:

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

    but you'll have to handle the case when deltay is more than deltax and do the loop in that direction.

    Edit: actually this would do it:

    variable delta= max(abs(x1-x0), abs(y1-y0))/32

    repeat delta times

    --- create sprite at (round(lerp(x0, x1, loopindex/delta)/32)*32), round(lerp(y0, y1, loopindex/delta)/32)*32)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • spongehammer

    For shifting the CoM as mattb said is to attach multiple objects together. At least for now that's the only way.

    mattb

    Looks good, you can also utilize the "on pre step" condition to negate the acceleration of gravity on the object, but looks like it's working well as is.

    The wrapper project is stalled currently. I'll pick it up again eventually though.

  • The level rectangles need to be pinned to the sprite you drag and then you can give the rectangles a variable with the name of the layout to go to, which you can use with "go to layout (by name)"

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

  • What is your use case for getting all the points between two lines? You mean for picking objects on the line?

  • As zenox said it mainly depends on the user. C2 makes a lot of things very easy, for things that aren't easy you can still do it with events in most cases. The SDK is nice and all but it isn't really necessary unless you want to interface with something outside of C2 like some js library that isn't covered by existing plugins. So most don't need to use it, as the event system can handle any logic you can devise.

  • Here's a capx for wall sliding with the 8dir behavior.

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

    All it is is a superior way to push the player out of solids than what the behavior does by default. Well, actually solid isn't used so that we can handle collision response ourselves instead of letting the behavior do it. The player is treated as a circle (which solves your third image), and the walls are all rectangles. The algorithm just calculates the closest corner or edge on each wall and moves out in the opposite direction. The velocity isn't messed with and it appears to work well enough without doing that.

    It has no dependence on the 8 behavior so it could be used in other ways. All that it needs is a player sprite and box sprites for walls with four image points at the corners.

  • For orbits with physics you can do it using equations of actual orbiting. Some info and capx on it here:

    Basically you can do the gravity force with "newton's law of universal gravitation" and set the orbit by setting the velocity to a calculated "mean orbital speed" and set the direction to be perpendicular to the direction from the moon to the planet.

    Calculating the impulse to change directions may be doable, just your standard algebra problem, but it's probably simpler to just set the velocity directly.

  • I was pretty sure SAT isn't used in C2. Just checked and no it's not. It does the collision detection with either bounding box overlap tests, which are very fast or "line intersection" and "point in polygon" tests for polygons. Collisions are resolved in most (all except physics) behaviors using the runtime's pushout functions which basically are loops that check for an overlap, move a bit and check again until not overlapping. The function used to push out in the nearest direction uses a spiral scan pattern to find a free space.