PinmikPanik/gamedata/objects/bg/movingbackground.py

13 lines
383 B
Python

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.game.dt
self.rect[1]+=self.spdy*self.game.dt