from behavior import Behavior
from game_logic import GameLogic


class Gravity(Behavior):

    def __init__(self, speed):
        super(Gravity, self).__init__()
        self.speed = speed
        self.old_y = 0.0

    def tick(self):
        self.old_y = self.game_object.position[1]
        self.game_object.position[1] -= self.speed
        for other in GameLogic.game_objects:
            if not GameLogic.collide(self.game_object, GameLogic.
                game_objects[other]):
                continue
            if GameLogic.game_objects[other] in self.game_object.collisions:
                continue
            self.game_object.position[1] += self.speed
            self.game_object.set_property('falling', False)
            return
        if self.old_y != self.game_object.position[1]:
            self.game_object.set_property('falling', True)
        else:
            self.game_object.set_property('falling', False)
        self.game_object.set_property('y_velocity', self.game_object.
            get_property('y_velocity', 0.0) + self.speed)
        self.game_object._moved = True

43dc084496ad2f6d180fe78f3aa8ceaa2cca8c99
<mask token>


class Gravity(Behavior):
    <mask token>
    <mask token>

<mask token>


class Gravity(Behavior):

    def __init__(self, speed):
        super(Gravity, self).__init__()
        self.speed = speed
        self.old_y = 0.0
    <mask token>

<mask token>


class Gravity(Behavior):

    def __init__(self, speed):
        super(Gravity, self).__init__()
        self.speed = speed
        self.old_y = 0.0

    def tick(self):
        self.old_y = self.game_object.position[1]
        self.game_object.position[1] -= self.speed
        for other in GameLogic.game_objects:
            if not GameLogic.collide(self.game_object, GameLogic.
                game_objects[other]):
                continue
            if GameLogic.game_objects[other] in self.game_object.collisions:
                continue
            self.game_object.position[1] += self.speed
            self.game_object.set_property('falling', False)
            return
        if self.old_y != self.game_object.position[1]:
            self.game_object.set_property('falling', True)
        else:
            self.game_object.set_property('falling', False)
        self.game_object.set_property('y_velocity', self.game_object.
            get_property('y_velocity', 0.0) + self.speed)
        self.game_object._moved = True

from behavior import Behavior
from game_logic import GameLogic


class Gravity(Behavior):

    def __init__(self, speed):
        super(Gravity, self).__init__()
        self.speed = speed
        self.old_y = 0.0

    def tick(self):
        self.old_y = self.game_object.position[1]
        self.game_object.position[1] -= self.speed
        for other in GameLogic.game_objects:
            if not GameLogic.collide(self.game_object, GameLogic.
                game_objects[other]):
                continue
            if GameLogic.game_objects[other] in self.game_object.collisions:
                continue
            self.game_object.position[1] += self.speed
            self.game_object.set_property('falling', False)
            return
        if self.old_y != self.game_object.position[1]:
            self.game_object.set_property('falling', True)
        else:
            self.game_object.set_property('falling', False)
        self.game_object.set_property('y_velocity', self.game_object.
            get_property('y_velocity', 0.0) + self.speed)
        self.game_object._moved = True
