PixelMonkey's Forum Posts

  • Whoops. Yeah the c2addon file was wrong, should be fixed now! I've also added the example capx, though at the moment it's very basic.

  • The Sonic Physics behaviour is a heavily adapted version of the Platform behaviour that can handle slopes and curves in the same way as the classic Sonic the Hedgehog games. The behaviour is mostly accurate to the physics of the games and is primarily targeted towards Sonic fangames, but the behaviour has specifically been made so that unneeded components can be disabled in some way, for use in other games.

    The goal of the behaviour is to be a simple to use as the Platform behaviour itself, aside from some obviously more complicated parts, so the behaviour works almost identically, handling Solids and JumpThrus as you would expect.

    The Sonic Physics Guide was referenced heavily in the development of this behaviour.

    At some stage I intend to work on a template containing supplementary events that didn't fit with the behaviour, as well as things you'd expect to find in a Sonic game, as a base for fangames and a better example of how to use the behaviour.

    Notable Features:

    • Snaps to angled surfaces, as long as speed is above a specified threshold
    • Slopes will affect movement speed and jump angle
    • Modified variable jumping to have a maximum and minimum jump rather than a sustain time (more accurate to old Sonic games)
    • Added variations on basic acceleration, deceleration etc parameters for when in the air or rolling
    • "Compare Speed" condition offers choice between X component, Y component, or both
    • Rolling, which works under the same conditions as it does in the Sonic games. On by default but easily disabled if it's undesirable.
    • More to come, hopefully!

    DOWNLOAD LINK

    EXAMPLE

    EXAMPLE CAPX

    Actions added/modified:

    • Actions corresponding to properties. In order to not clog up the action select window, selecting a property with multiple versions (like acceleration) will offer a combobox asking which variation you'd like to set.
    • Simulate control: Roll
    • Trigger roll/unroll. Overrides the initial conditions for rolling (ie, this isn't the same as "Simulate control: Roll") but triggering a roll is still subject to unroll conditions (ie low speed) and vice-versa.
    • Removed "Set Jump Sustain" as I've changed how the variable jumping works.

    Conditions added/modified:

    • As mentioned above, the "Compare Speed" condition now has an extra combobox to specify whether you'd like to compare X vector, Y vector, or both. Both is the default, which functions as the Platform behaviour's "Compare Speed". Equivalent to comparing Object.SonicPhysics.VectorX/Y.

    Expressions added/modified:

    • "SurfaceAngle": The angle of the surface the player is on. Returns 0 if not on an object.
    • See list of properties below. Most (or all) of those have a corresponding expression to get their value at runtime.

    Properties added/modified:

    • "Soft Max Speed": Max Speed has been separated into two components. This one is the top speed the object can reach via its own acceleration on flat ground.
    • "Hard Max Speed": Essentially the old Max Speed property. The object simply will not move higher than this speed, horizontally. Best not to make this too high, as if you reach these speeds it'll likely start clipping through solids.
    • "Friction": Renamed "Deceleration" property. Effectively passive deceleration, slowing the player when no input is present.
    • "Deceleration": Active deceleration, slowing the player when their input is in the opposite direction of their movement.
    • "Air" versions of several of the above: Take effect when the player isn't on the floor. Mostly optional so as not to require swapping things around in events all the time.
    • "Rolling" versions of several of the above: As with the "Air" versions, these apply when the player is rolling. Of note is that acceleration is set by default to 0, though this isn't necessary.
    • "Roll threshold": The speed at which the player must be moving to be able to roll.
    • "Unroll threshold": The speed below which the player will revert back out of a rolling state.
    • "Uphill slope factor": The rate at which an uphill slope slows the player.
    • "Downhill slope factor": The rate at which a downhill slope will speed up the player. If both are identical, then the player will remain at essentially the same speed after going down and up to identical slopes, if not factoring acceleration if they go below the soft max speed.
    • "Roll" versions of slope factor. To get the effect of rolling giving more acceleration, have uphill factor be significantly lower than downhill.
    • "Wall Speed Threshold": The speed below which the object will lose its grip when moving on a wall or ceiling surface.
    • "Max jump speed": I've changed the variable jump height setup so that instead of moving at a constant rate when the jump key is held (like the Platform behaviour), there is a maximum jump and a minimum jump, with the engine automatically giving you something inbetween if the jump key is released between the two. This is done because A: it's more accurate to the Sonic games and B: It gives a more parabolic jump curve.
    • "Min jump speed": As above. Should obviously remain lower than max jump speed, or identical if no variable jumping is desired.
    • "Rolling Enabled": Set to quickly disable rolling. Same effect can be acquired by disabling default controls and simulating all but the roll key, but this is quicker. This will also effectively disable any rolling-related actions.
    • "Rolling jump control lock": In some Sonic games, jumping while rolling would lock the controls. It's enabled by default for accuracy's sake, but it could definitely be undesireable so it's optional.
    • "Set Angle": Whether the object will rotate at 90 degree intervals when moving across slopes. NOTE: Not currently working yet. I want to make it offset the position so as not to cause the object to clip into or off of collision polys but that's not quite done yet.
    • "Air Drag Rate": The amount X speed is multiplied by each 1/60th of a second, under certain conditions.
    • "Air Drag Y Threshold": Y Speed, in pixels per second, above which Air Drag is applied. Must be below 0.
    • "Air Drag X Threshold": X Speed, in pixels per second, above which Air Drag is applied.
    • "Downhill Slope Factor Threshold": Distance, in degrees, from 0, under which downhill slope factor will not be applied.
    • "Uphill Slope Factor Threshold": Distance, in degrees, from 0, under which uphill slope factor will not be applied.
    • "Falling Angle Threshold": The lowest angle of terrain the object can fall off of.

    TODO:

    Rotate the object at 90 degree intervals while moving

    Add smoothAngle expression (and X/Y offsets) to allow smooth rotation on slopes

    Allow objects to move with a rotating Solid object (think seesaws)

    Make TileMaps work. See Known Issues!

    Known Issues:

    Tilemap doesn't work! Tilemaps use an array of collision polys (I think) rather than just a poly or bounding box, and I'm still working on making that work. If anyone knows a simple way to get the relevant collision poly from a tilemap via the sdk, please let me know! Should be fixed in the next release, provided I can figure this out. For the time being, I'd suggest making tilemaps not solid, and having solid sprite objects act as collision.

    Changing Angle of Gravity can mess with things. This is definitely something I want to fix (Mario Galaxy planets with Sonic Physics, anyone?) but with the behaviour being as complicated as it is it may take a bit of time.

    Possibly the most important one: Intended for use with Sprites with collision polygons set to bounding box. Preferably square, but that's just so that all sides are even, since the behaviour doesn't yet rotate the object. The methods I used for getting points of collision are somewhat shonky and "good enough", but I'd prefer to redo them at some stage (which also ties in somewhat to the tilemap stuff). For now, the behaviour works best if you have a rectangular Sprite. For rotation, you can have another Sprite pinned to it that changes angle along with the SurfaceAngle expression.

    If you have any feedback, requests, or bug reports, please share them in this thread!

    It's worth noting that this is the first Construct 2 addon I've worked on, as well as the first time I've played around with javascript, so if anyone with more experience in either of those things has suggestions for improving this, I'd be happy to hear them!

    Update: Release 1.0.3

    Changes:

    -Set Soft Max Speed now works

    -Vector Y is no longer capped to Min Jump Strength if jump button isn't held (should allow springs and bumpers to work)

    -Rolling Jump Control Lock now functions if enabled

    -Removed Is Double Jump Enabled condition

  • Yeah, proper behaviour addon, mimicing Sonic physics. Got the essentials down, like you can see in the gif, just working out the details.

  • Working on a behaviour:

    http://gfycat.com/GratefulEcstaticBluemorphobutterfly

    Speed on the gif's all messed up, it looks a lot smoother than that normally.

  • I've run out of time to turn what I have into something releaseable, so I think I'll have to back out of this again. Next time I'll keep the scope a bit more reasonable.

    Looking forward to seeing everyone's entries!

  • Participating again, best of luck to everyone else joining in!

  • The LD sort of slowly flopped over and failed for me, so I haven't managed to finish anything this time. Loving these other entries, though!

  • Definitely doing this, it's the first time since last December that I'll actually have a full 48 hours to work on it!

  • Sandy Dunes Tilemap — Now for sale in the Scirra Store!

    https://www.scirra.com/store/royalty-free-game-tilemaps/sandy-dunes-tilemap-294

    <p>This tileset contains 64 tiles in total, suited to 2d platform games. Each tile is 16x16 pixels, and the set includes an 8-bit image with an indexed palette that can be modified to suit your level's needs!</p><p>This set has a variety of sandy slopes, several pyramid tiles, and modular plants!</p>

    Use this topic to leave comments, ask questions and talk about Sandy Dunes Tilemap

  • Ice Plains Tilemap — Now for sale in the Scirra Store!

    https://www.scirra.com/store/royalty-free-game-tilemaps/ice-plains-tilemap-293

    <p>This tileset contains 64 tiles in total, suited to 2d platform games. Each tile is 16x16 pixels, and the set includes an 8-bit image with an indexed palette that can be modified to suit your level's needs!</p><p>The set features snowy and icy surfaces, directional signs, spikes, modular trees, and several decorations!</p>

    Use this topic to leave comments, ask questions and talk about Ice Plains Tilemap

  • I had more time than I expected over the weekend, and managed to make something:

    http://www.ludumdare.com/compo/ludum-da ... &uid=14203

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The theme is connected worlds!

  • Sadly it falls right in the middle of my uni work for me, so I won't manage to join in on this one, but I should have plenty of free time for LD31 in December! Good luck to everyone planning to take part, and have fun!

  • Hm, I'm out for this one. Made a bit of progress, but it's become rather buggy and messy, and I don't have the time to clean it up to a simply playable state. It's been fun, I got to play around with blend modes a bit, which is something I haven't had a chance to do yet, but I have a couple other things I need to be doing.

    Best of luck to those still in the dare!

  • The theme is Beneath the Surface!