R0J0hound's Recent Forum Activity

  • Yeah, i'd use a family to handle two instances of the same type.

  • Prominent

    It only doesn't work for joints that were just added in a post collide. It has to do with chipmunk not allowing anything to be added or removed during a pre or post collide, so instead the plugin delays it slightly. The unfortunate drawback is it causes a lot of bugs related to stuff just added in those triggers.

    I don't have a simple fix for it, so it's an open issue for now.

  • Collisions would basically mean re-creating the physics behavior with events to be able to step the physics multiple times. Which isn't ideal at all. The way peggle probably did it was leverage the physics engine itself to do many simulation steps at once to instantly trace a path. C2's physics behavior only steps automatically per frame. It's not possible to step it manually.

    For now you could get away with continuously launching balls to trace the path. It wouldn't be instant but it would show the path.

  • You can improve the rendering speed of the tilemaps by setting "seamless mode" to off in the tilemap properties.

    In addition to that set "pixel rounding" to on and "fullscreen scaling" to low quality.

    Here's the latest of my capx that saves chunks that were modified.

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

  • Using the "is within angle" should do it.

    Angle(player.x, player.y, object.x, object.y is within 90 degrees of player.angle

    ---- (object is in front)

    Else

    --- (object is behind)

    That's for one player and one object. To work with multiple of each, add a "for each" player and object condition and put the events above as sub-events.

  • There's an example here that draws the path of the object.

    It doesn't do collisions though.

  • Prominent

    That should work. I'll have to look at it tomorrow to see why it doesn't.

  • Glad it was useful. I'll take a look at what your capx tomorrow.

    I thought of a simple way to save changes to the array.

    Basically just change the tiles on the tilemap like normal, but when you do, set a Boolean variable to save that tilemap.

    When that Boolean is set and before moving a tilemap that moved off screen, store that tilemap in a dictionary object.

    With this key

    X&" "y

    And this value:

    Tilemap.asjson

    Then after moving check if the current tilemap position is in the dictionary. If it is, load that json. If it isn't call update.

    That way only tilemaps that are changed are saved.

    Enemies could be tricky if they're off screen since they would no longer have a tilemap to interact with. Two ways around that come to mind. One would be to put the object to sleep if offscreen. Another would be to maintain some tilemaps around the enemies, however this could prove complex.

  • Ok, here's the result:

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

    Probably should have called it spelunking turtle.

    I set it up with 64x64 tilemaps with 4x4 tile size and it works decently. I get about 30fps on my machine, so I assume most others will get a higher fps. I briefly tried 128x128 tiles but it seemed to stall a bit more. Also I had some more fun with perlin noise in this one. I found you can combine it in various ways to create some interesting terrain.

    It can be made faster I think if I use some javascript to do what the update function does, and create a json that can be loaded into the tilemap. But for now it's decent.

  • You may be able to work around that by resizing the sprites first so they overlap before that check. Then afterwards resizing them back.

    Or you could move the imagepoints a bit further off the collision polygon.

  • What could be done is a chunk based approach so the tilemap could be used. The idea would be to do the same as my example but use multiple tilemap objects that you move around and update the tiles in them when they're moved around.

    I'll try to give that a go tomorrow, it sounds promising.

    The next problem to consider is a way to keep track of terrain changes if you want to be able to add/remove tiles as the game runs.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Using a tilemap for this could be tricky and may not give any gains since it looks like you'd have to update the whole tilemap every time you scroll. I'll have to think about it some more though.

    Scrolling in other directions will only take one event a piece, and will look much like the one to scroll right. I'm away from my PC atm.

    Only the randomize seed action sets the state. The perlin2 expression will always give the same value for an xy if the seed is the same.