R0J0hound's Recent Forum Activity

  • JohnnySheffield

    Feel free to use/fork/modify this plugin, I don't mind at all. I'd have to look in to setting up a github but it's not high on my priorities list. And cool icon, thanks, I'll be sure to include it in my next update.

  • Look in the plugins section of the forum, there's a plugin there that does that and I think it's actually called "multiline textbox".

  • If you're fine with the projectile stopping when hitting solids you could give the object the platform behavior, disable controls and set acceleration and deceleration to 0. Then you can throw it by setting the vectorx and vectory with events.

    In that case there is a little bit of math but not to much:

    If you know the speed and angle you want to launch the axe do this:

    vectorx = speed*cos(angle)

    vectory = speed*sin(angle)

    Or you could use the bullet behavior and set the gravity property.

    There are capx' around the forum. A search for "projectile" will yield a lot of useful topics.

  • Hi, here's my 2c.

    Since the motion is just along a circle we can calculate the center and radius of that circle and build a nice exact formula to find where the object will be. You do have to account for the case where the rate of turning 0, because motion will be in a straight line and my formula will fail.

    Here's a capx:

    [https://dl.dropboxusercontent.com/u/5426011/examples20/position_perdict.capx

    The last 3 events are the formulas. The rest is just gui nonsense.

  • I used the collideCheck function instead of using the events directly because I just wanted to know if the player is colliding, I don't want to pick the walls. The only reason for that was the nested overlap check in event 12; it needed to check with all the walls not just picked ones. Event 10 moves the player to the position it was at at the start of the frame, then events 11 and 12 move the player again but only a pixel at a time in the same direction. This is to close the gap with the wall. The player's d variable is reduced by the amount moved. This is important so the wall sliding can only go the remaining distance.

  • You could use 5/level if you want level 1 to spawn an enemy every 5 seconds. At level 10 it would be every 0.5 seconds and at 20 it would be every 0.25 second. This works well if you want infinite levels where ultimately an enemy will spawn every frame. You could also tweak the formula further to be

    start_rate/level^factor

    Where factor could be 0.5 for a slower increase of the spawn rate or 2 for a faster increase.

    Another approach you can use if you have a max level is to use lerp. It would look like this:

    lerp(start_rate, end_rate, (level-1)/(num_levels-1))

    So for example if you had 50 levels and you wanted the spawn rate to be 5 seconds on the level 1 and every tick on level 50 your forula would be lerp(5,0,(level-1)/49).

    In general you may be able to use some kind of easing functions to do it too.

    Edit:

    For the second question you could utilize something like this:

    http://www.scirra.com/forum/weighted-probabilities_topic48421.html

  • It allows you to draw a quad using an arbitrary part of a texture.

    This is the definition of the function.

    quadTexUV = function(tlx, tly, trx, try_, brx, bry, blx, bly, tlu, tlv, tru, trv, bru, brv, blu, blv)

    The first two letters of the parameters indicate what corner of the quad it defines. For example tlx is "top-left x", bru is "bottom right u". So for four points you have x,y,u and v. x and y is the point's position on the layout and u,v is the texture position of a texture which are in the range of 0 to 1. Where for u 0 is the left side of the texture and 1 is the right. For v 0 is the top of the texture and 1 is the bottom.

    It's basically like uv editing in 3d modeling programs except there is no z so the example you referenced isn't possible.

    To use it call it in you drawgl function with glw.quadTexUV. To my knowledge there isn't a plugin that uses it yet. quadTex is used however to use a sub-rectangle of a texture. The sprite object uses it when animations are exported to spritesheets. I have also used it in my spritesheet plugin.

  • Here's an updated capx:

    dropbox.com/s/na6na5973321hfw/event_motion2.capx

    It will work with arbitrary collision polygons but the wall sliding works best when the edges are in increments of 45 degrees. I found I didn't need that complicated vector math so all the formulas are fairly simple.

  • You can use the "^" symbol, it does the same thing.

    Eg to do Pow(2, 3) in c2 you would write

    2^3

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • If deltatime is holding you back then ignore it and do your motion without it and deltatime can be added later.

    Anyway 8direction is simple enough to make with events. The main thing that's tricky is collision response or with those videos wall sliding. Here is a capx with the preliminaries of collision response.

    dropbox.com/s/zf155w238lbomsw/event_motion.capx

    It's incomplete as I ran out of time today. If you remove event 14 then it should basically work like the behavior. On a side note you can get motion with the behavior without acceleration or deceleration by setting them very high.

    Anyway since you can't access the collision polygon from events you'll have to either make assumptions about the wall shape or devise a way to find approximately where the collision occurred and the angle of the side hit. One documented method floating around the internet is the separating axis theorem (or SAT). The only drawback is it's a bit lengthy and tedious to make with just events, although as a plugin it could be useful.

    I'll try to finish the example up over the next few days.

  • R0J0hound - Couldnt you also just calculate the z order by placing a image point in the upper left corner of the box and sort using that?

    For each Family1 ordered by Family1.ImagePointY(1) ascendeing

    --- Family1 move to top

    Test it and see. The bottom right box doesn't get sorted correctly right off the bat.

  • The cap file format hasn't changed since 0.99.96, so anything newer than that will work.