PinmikPanik/gamedata/objects/bg/movingbackground.py

13 lines
357 B
Python
Raw Normal View History

2021-09-10 19:22:30 +02:00
from gamedata.objects.bg.backgrounddrawer import BackgroundDrawer
class MovingBackground(BackgroundDrawer):
def __init__(self,x,y,game,w,h,sprite,ratio,spdx,spdy):
super().__init__(x,y,game,w,h,sprite,ratio)
self.spdx = spdx
self.spdy = spdy
def step(self):
self.rect[0]+=self.spdx
self.rect[1]+=self.spdy