R0J0hound's Recent Forum Activity

  • bloodshot

    Just multiply the speed by an value between 0 and 1 when it bounces

    Set Yvelocity to -0.5*abs(Yvelocity)

  • It involves finding the angle of the spot on the polygon the player hit and canceling the speed moving against the object. You can look here for a few examples you may be able to use in your game.

  • tgeorgemihai

    You probably could do that with only two paster objects. One to paste a players view and then a second that you paste the views to.

    Use paster if the game has webgl on, otherwise it doesn't matter, you can use either.

  • One thing I see that would simplify the z-ordering is if you only did a hexagon at a time. Actually with that you could easily enough handle collisions and movement within a hexagon very simply. You could mask out everything outside the hexagon. This does introduce a different problem though, transitioning from one hexagon to another which is mainly a matter of changing the player's position. That the point I'm stuck currently, just need to come up with a clever way to do that.

  • 1.

    No it doesn't, either is just as fast.

    2.

    First C2 filters down the possible collisions with collision cells:

    https://www.scirra.com/blog/ashley/6/co ... on-in-r155

    Next it sees if two object's bounding boxes overlap, and then it sees if the collision polygons overlap.

    Basically it goes from fastest check to slowest and stops further checks if objects can't be overlapping. The more collision poly points the slower a check will be.

  • You could do that. If it's just a probability of happening or not you could just compare with one value.

    aka random(100)<40 for a 40% chance.

    If you want a probability of more than two things happening you would store random(100) in a variable first. So for example you want A to have a 30% chance and B a 10% you could do:

    global number rand=0

    every tick

    --- set rand to random(100)

    rand is between 0 and 30

    --- do B

    rand is between 30 and 40

    --- do B

  • mh11

    I've seen the question come up often and there are two solutions.

    One is to pick one object and store it's values in a variables and then in a separate event pick the other one and use the values to do something. One quick thing you can save to a variable is the object's iid then you can use expressions like Sprite(1).x+sprite(2).x to add the x values of two separate instances for example.

    Another more useful thing you can do is to make a family containing only that one object type, then in events you can pick two separate instances independently. If you use C2's physics you have to use the family route.

    viewtopic.php?f=148&t=91829&p=718895&hilit=rope#p718895

    With the chipmunk behavior it makes things simpler, you specify the uid of the other object to attach the joint to and avoids having to use a family or even picking at all if you want to design joints in the editor.

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

  • mh11

    I don't follow. How are you not able to to refer to them from physics? Guess I'll have to look at your other topic.

  • Zebbi

    I don't think so, the projection math is slightly different.

  • mh11

    1.

    The collision polygon isn't something the C2 usually lets you do, and the behavior just grabs from that. The only plugin i know of that let's you change the collision polygon is yann's polygon plugin, but I haven't tested it recently to see if it works well with the behavior.

    2.

    It's very simple with this behavior. Just apply a force at an offset. The offset can be any point on the object and applying multiple forces work as expected

    For what you're actually trying to achieve the best current solution is to join all the objects together with physics joints, but even then it can't be completely rigid. A proper solution where all the joined objects form one rigid object is possible with the box2d or chipmunk libraries themselves, but nothing is exposed to C2 for design reasons. The question to do it has come up before and my proposed solution then was to use the chipmunk library with js instead of the behavior.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Global and local variables are some of the best features of c2 in my opinion. Dictionaries have their uses but I seldom need to use them.

  • No thoughts other than that looks complex. It probably doesn't need to be.

    The idea I presented basically points a sprite in a direction and increases it's width until an object is hit. That gives the hit object and a point of collision.

    Yours seems to set the sprite to be full length first and then add all the overlapping objects to an array, then loops over the array in some way while shortening the line by halves. So I'm guessing some kind of binary search? I guess I'd have to look at the tutorial you reference. My guess is the issue may be the order of the sprites, but really there is no way of knowing without something to test.