R0J0hound's Recent Forum Activity

  • abs(x1-x2) will give the x distance between two x positions.

  • I missed your capx but have a look at overlapping at offset.

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

  • I goes completely transparent for me on my computer. I don't know why it wouldn't... Does it fade at all?

  • This isn't really a beginner topic and since you said you've made an interpreter before you likely know better than I on how to make one but here is a way to do it.

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

    It's an interesting idea but it's probably better to just make the games in C2 and have one project that opens links to the other games.

  • Try Construct 3

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

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

    Here's a way to do it with the same formula I used before.

    https://www.dropbox.com/s/eldpa0s7zvfr3 ... .capx?dl=1

    /examples22/orbit2.capx

    A family was used so I can pick two different instances of the same object type. Also all the numbers are kind of arbitrary, e.g. G, masses, velocities and positions. I just tweaked them until I got an acceptable motion. However there is no reason why you couldn't use scaled values from actual planet data.

  • So the frame and health ratios are the same so:

    Health/maxHealth = frame/28

    Solving for frame:

    Frame = Health*28/maxHealth

    Next we need to round it to a whole number, and since we want frame 0 to be used only if the health is 0 we will use ceil() to round up.

    So the formula is:

    Frame = ceil(Health*28/maxHealth)

  • I drew the lines in black, flood filled the areas to erase in black as well then flood filled with transparent.

  • For more planets change the "every tick" to "for each planet" and add another "every tick" event below and move the "set position" action to that.

    To make it work with the bullet behavior you'll have to covert the speed and angle of motion to vx and vy in an "every tick" before the events and back at the end of the events. Also the "set position" can be removed and the overlap and bounce event should be either before or after the events.

    Here are the conversion formulas:

    Vx=speed*cos(angle of motion)

    Vy=speed*sin(angle of motion)

    And

    Speed=distance(0,0,vx,vy)

    Angle of motion=angle(0,0,vx,vy)

  • You can, but it's mainly up to you to make the pieces.

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

    My workflow:

    1. clone the object that I want to fracture.

    2. open the image editor and draw lines on it to split it up into parts.

    3. duplicate that frame for every part.

    4. Then I edit each duplicate frame and erase each other part off the image.

    5. Adjust the collision polygons and crop. (don't touch the origin point)

    6. After that I had to click the Make 1:1 to fix the scale.

  • Here is a way to do it very smooth, although not terribly useful in your case.

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

    For your idea just break it down into smaller problems.

    * For any given pipe section you need a way to find connected pipes. My capx did it by storing the uids, but you'll probably want to do it with an overlap check since you'll be adding sections when the game is running.

    *After that the filling is much easier. You can do a method like I did or just make an animation for each section of the pipe filling from either direction. Then starting with some pipe, set it to fill. When it's full start filling the connected section.

  • vtrix

    You could use the canvas for that. You want to be able to change the tile graphics at runtime right?

    One thing to keep in mind is you should only have only one canvas instance per texture to save vram and just position and paste into every location.

    The "paste" action already does the relevant calculations so the pasted object at the correct location on the canvas. As far as seams, if they show up you could make the tiles slightly bigger so they overlap a bit.

    For performance the tilemap object would be the best way to go, but you do get more flexibility using the canvas.

  • Here is an example of an orbit based on Newton's law of universal gravitation.

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

    Basically it means that the velocity of the moon is taken into consideration.