20 lines
454 B
Python
20 lines
454 B
Python
from gamedata.objects.base import BaseObject
|
|
|
|
import webbrowser
|
|
|
|
class Link(BaseObject):
|
|
|
|
def __init__(self,x,y,game,image,link):
|
|
|
|
super().__init__(x,y,game,w=image.get_width(),h=image.get_height())
|
|
|
|
self.sprite = image
|
|
self.link = link
|
|
|
|
def step(self):
|
|
|
|
if self.rect.collidepoint(self.game.inputs["mouse"]["pos"]):
|
|
if self.game.inputs["mouse"]["click"]==1:
|
|
webbrowser.open(self.link)
|
|
|