Skip to content

Add FollowStyle class #190

@IQAndreas

Description

@IQAndreas

This will allow you to create your own FollowStyle for the camera (perhaps you want it to pan easily whenever something moves instead of "jumping" immediately to the correct position?

And if you want a custom deadzone, you would either extend the class, or call something like camera.follow(target, new FollowStyle(cutomDeadzone));.

But primarily, it will use things like FollowStyle.LOCKON, and second, it will reduce the code in FlxCamera#follow() to something like:

public function follow(Target:FlxBasic, followStyle:FollowStyle):void
{
    target = Target;
    deadzone = followStyle.getDeadzone(this, target);
}

Bleh, maybe it's just easier to show these proposed changes with actual code once we get to that point. This is probably the least clear suggestion I have written so far. :/

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions