Change my existing movement system to sub-pixel movement

Welcome to our brand new Clickteam Community Hub! We hope you will enjoy using the new features, which we will be further expanding in the coming months.

A few features including Passport are unavailable initially whilst we monitor stability of the new platform, we hope to bring these online very soon. Small issues will crop up following the import from our old system, including some message formatting, translation accuracy and other things.

Thank you for your patience whilst we've worked on this and we look forward to more exciting community developments soon!

Clickteam.
  • I've come a bit into building my game with a movement system that i borrowed from, i think it was Almighty Zentaco?
    The movement works great with good collision and all that.

    But I just realized that I would need to rework this movement system so that it becomes sub-pixel based instead.
    At the moment you can only move with a minimum of 1px speed, but I need to be able to work with sub-pixel movement cause in it's current state is a bit too fast.

    I've already implemented this movement so deep in my current project that it would be a nightmare to try and redo it all with a completely new movement. Therefore I would need a solution to the current one.

    Any help would be greatly apprechiated!
    I've attached a .mfa file into this thread with the movement that I would need tweaked.

    Please login to see this attachment.

  • I'm sure you've seen the AlmightyZenTacos sub-pixel movement tutorial, but you should also checkout his FastLoop tutorial: Please login to see this link.

    I learned how to make sub-pixel movement really easy from that tutorial and I can make sub-pixel movements with gravity acceleration and horizontal movements in less than 5 minutes.

    I don't think it would be too difficult or time consuming to go back and modify your events to be more similar to that of his FastLoop tutorial. Also, the fastloop tutorial demonstrated how to get sub-pixel movements in a platformer, so hopefully it will still work here.

    Hope this helps :)

  • Agree elvisish, we speak a bit improperly of subpixel movement, Fusion will anyway render int position,
    (maybe there's a shader around "faking" it through alpha across pixels)
    though we can handle float positions "behind the scenes" so that's what we generally mean X)

    here's one possible solution AndyBazooka:
    Please login to see this attachment.
    (group movement#2, you can set MoveSpeed to a floating point value)

    I've added two values: MoveAng and MoveFract in player collision mask, I've not used the counters though
    Also note it's a full 360 degrees movement so you can use it for any angle if you wish by setting the MoveAng value

    a selection of my Fusion examples can be found Please login to see this link.

  • I'm not aware it's possible for Fusion to render anything other than int positions?

    As far as I know, it can't. But if you use alterable values for the X and Y position of an object (and always set the X and Y position of that object to those xPos and yPos alterable values) and add a float value to either the xPos or yPos value, Fusion will move the object every time the objects X or Y position changes by a whole number.

    For example, say we have an object at (0,0) that is set to always have it's X and Y position to change to it's xPos and yPos alterable values. Then we add 0.5 to xPos. The object's X and Y position is still (0,0), but xPos value is equal to 0.5.
    If we add another 0.5 to xPos, xPos will be equal to 1. Now that it's an integer, Fusion will decide to move the object. In this case, it's currently sitting at (1,0). The coordinates of an object will only ever be whole numbers and will always display on screen correctly, but using float values for the xPos and yPos and speed values will allow us to make Fusion only update the objects position when it's able to (meaning xPos and yPos have gone up/down at least 1 whole pixel).

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!