R0J0hound's Forum Posts

  • I see what you mean by the blob not being a solid color after using the alpha clamp effect. At least with any color but black. I think it has to do with how the effect handles premultiplied alpha perhaps if someone wishes to make a modified effect.

    As for the quality of the edge you can use different gradients to change that a bit. I’ve found the soft brush in the C2 image editor makes a nicer gradient than the soft brush in C3’s image editor, but other image editors could create better ones.

  • Finally got around to finding a decent solution to this.

    To do the jump I have it squish horizontally as if it was a muscle. I works pretty well as it jumps only if on the ground.

    dropbox.com/s/5ao27efbsdox8bm/jello_no3rdParty_keyboard2.capx

  • I was going to attempt to make an example but I found a lot of previous tests that may be helpful. There are probably more but my naming convention is inconsistent. Some use physics for the motion, and some do the motion with math in events. I skimmed over them briefly but maybe a third of them have the forces between every pair of objects.

    dropbox.com/s/8bimqsdnysh5bov/orbital_simple.capx

    dropbox.com/s/eldpa0s7zvfr333/orbit2.capx

    dropbox.com/s/tk76c6cmc4vlocd/orbit.capx

    dropbox.com/s/5dpb882vdi03d00/orbit.capx

    dropbox.com/s/gle6gz7lbo18cq7/orbit_physics.capx

    dropbox.com/s/9zx2ivqzli2ewbx/orbital.capx

  • Ah, so you mean just rolling a sprite then?

    dropbox.com/s/gora2uebn0e4wov/box_roll.capx

    Even found an old example that does it in a different way.

    dropbox.com/s/kx8kbfpqpimuec5/box_walk.capx

  • Roughly you’d do this to apply gravity between two objects a and b. You’ll have to tune it though. Adjust the masses of the objects, and the g variable.

    Var g=10000
    Var ang=0
    Var force=0
    
    Every tick
    — set ang to angle(a.x,a.y,b.x,b.y)
    — set force to g*a.mass*b.mass/distance(a.x,a.y,b.x,b.y)^2
    — a: apply force (force*cos(ang), force*sin(ang))
    — b: apply force (-force*cos(ang), -force*sin(ang))

    That handles the gravity between a pair of objects. You’d just have to do that between every pair.

    If you search my posts I’ve made an example or two in the past if that helps.

  • Here is a possible way using a distort mesh to make the cube and some math to rotate around a center on an axis.

    dropbox.com/s/5n5umhdkfhr0qhg/cube_roll.c3p

  • winstreak

    Nice analysis.

    From that idea the distance on the grid with diagonals would be

    int(max(abs(treasure.x-tile.x),abs(treasure.y-tile.y))/32)

  • For each black hole apply a force to the sprites toward blackhole.x,blackhole.y and the amount of force would be

    K/distance(sprite.x,sprite.y,blackhole.x,blackhole.y)^2.

    K is just some number. If the black hole is too weak just use a bigger number.

  • You do not have permission to view this post

  • Nice job on the terrain and changing the angle of the truck.

    It's not super easy to tell how high you are other than the fast rising water. That driver has nerves of steel to attempt driving in such a volatile ecosystem.

    I wonder if giving some more variance to the grass texture may help with showing the elevation. Anyways, I had some fun seeing how long i could survive.

  • You may get better performance with a canvas instead of tilemap.

    Even with a tilemap with 1x1 tiles its slow even just erasing.

    dropbox.com/s/0jkp71pl9nvyw08/roomba_tilemap.capx

    An alternate idea is to grab a screenshot and use some JavaScript to scan the image for set pixels. It works, but it needs to flicker as I need to hide the other layers for a frame.

    dropbox.com/s/il3xbkj19f8n78n/roomba_screenshot.capx

    So here's the example using the C3 canvas. It works well for erasing but loops in events are slow, so here it does the scan of the pixels over multiple frames. Seems to work well, but if you resize the game window in any way the canvas will clear. May need some more logic to periodically save the canvas and reload it as needed.

    dropbox.com/s/ki35vb1bx2xztuf/roomba_canvas.c3p

    If you have the full version of c3 you could also handle the canvas pixel scanning in javaScript as that would be much faster.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Scroll down on the properties and click "Make 1:1" to correct that.

    Typically you shouldn't get values like that. I've gotten decimals like that when I change sizes of scaled objects or something like that. But I don't understand how that occurs for unscaled objects.

  • Here's how you can run the version of construct that "epic platformer" says it needs to run.

    editor.construct.net/r251-2

    From the description of that template it uses a lot of third party plugins. Some of those plugins were ported to c3, but there was change after r251.2 that requires more involved updates to get those plugins working, and the original authors of the plugins aren't working on them anymore.

    Some folks avoid third party plugins completely and just stick with plugins included in Construct. I post examples on the forum all the time and even though i primarily use C2 most all of the examples can be opened and work in C3, except for some cases.

    Anyways, if you decide to try to keep learning construct I'd recommend first trying the free templates and examples bundled with Construct. They are maintained so you don't have to worry about getting them working. The forum is also a good resource for finding examples of solutions to various things. Personally I haven't used the asset store at all, but quality and support can vary from the looks of it.

  • Here's a way to do the trimming.

    dropbox.com/s/al8uh05egssr79p/trimArray.capx

    It amounts to scanning the whole array and finding the min/max of x/y for any cell containing a value. Then the the values are shifted over and the array is resized.

  • Else when used with object conditions may not do what you want.

    Sprite: x<100
    — do something
    Else
    — do something else. No sprites are picked

    One possible solution is to use the system compare condition instead of object conditions so you take picking out of the situation. Bear in mind this would work because there’s only one player object.

    So from this

    Compare: obj = “axe”
    Player: slotfull<6
    — place in inventory
    Else
    Compare: obj = “axe”
    Player: slotfull=6
    — place on ground

    To this

    Compare: obj = “axe”
    Compare: Player.slotfull<6
    — place in inventory
    Else
    Compare: obj = “axe”
    Compare: Player.slotfull=6
    — place on ground

    But there are other ways to structure it. You don’t always need an else. I’d probably go for something like this

    Compare: obj = “axe”
    — Player: slotfull=6
    — — place on ground
    — Player: slotfull<6
    — — place in inventory