__init__.py 文件源码

python
阅读 25 收藏 0 点赞 0 评论 0

项目:spygame 作者: sven1977 项目源码 文件源码
def get_y(self, x):
        """
        Calculates the y value (in normal cartesian y-direction (positive values on up axis)) for a given x-value.

        :param int x: the x-value (x=0 for left edge of tile x=tilewidth for right edge of tile)
        :return: the calculated y-value
        :rtype: int
        """
        # y = mx + b
        if self.slope is None or self.offset is None:
            return 0
        return self.slope * min(x, self.max_x) + self.offset * self.rect.height
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号