Skip to content

Projectile wrong y coord #5

@will-emmerson

Description

@will-emmerson

Projectile has y coord that is always twice as much as it should be.
E.g. if I fire a projectile and print out it's position immedietIy I get the following output:

Position:   1003 -1336
projectile: 990.5,-2692.5

So either player or projectile has wrong scale for y coord.
Is this the culprit?

class AdapterCoordY(Adapter):
    """Converts X coordinate from a uint16 to the range +-16384
    Although the default map only uses a +-8192 vertical range"""
    def _encode(self, obj, ctx):
        return (obj * 2) + 32768
    def _decode(self, obj, ctx):
        return (obj - 32768) / 2.0

I don't understand why some coord updates are using AdapterCoordX/Y and some are using AdapterCoord24.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions