PinmikPanik/gamedata/objects/bg/movingbackground.py

13 lines
383 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):
2021-09-14 16:09:42 +02:00
self.rect[0]+=self.spdx*self.game.dt
self.rect[1]+=self.spdy*self.game.dt