import mwpy_static

MWPYStaticObject = mwpy_static.MWPYStaticObject
MWPYGameObjectType = mwpy_static.MWPYGameObjectType
MWPYGameObjectState = mwpy_static.MWPYGameObjectState


class MWPYSpring(MWPYStaticObject):
	def __init__(self, gameObjectType = MWPYGameObjectType['MWGOT_SPRING']):
		MWPYStaticObject.__init__(self, gameObjectType)
		self.force_x = 0
		self.force_y = -50.0
		self.state = MWPYGameObjectState['AS_NONE']
		self.status = 'AS_NONE'

	def switchon(self):
	       self.status = 'AS_PLAY'
	       self.state = MWPYGameObjectState[self.status]

	def switchoff(self):
	       self.status = 'AS_NONE'
	       self.state = MWPYGameObjectState[self.status]

	def do_update(self, delta, currenttime, world_dict):
		self.state = MWPYGameObjectState[self.status]
