Hello again
In my "game" I have added powerups that when player catches on green lasers will shoot from the spaceship. However they only fire once and I want them to keep fire for about 10 sec. I have tried using a counter that counts down when collision with powerups appear. But that made pythonista crash. So is there a way to add a timer or similar for functions in scene?
In my mind there should be a way when using the run_action for the "laser" to make it last about 10 sec
Here is the code for the laser function:
def multi_laser(self):
mlasers = SpriteNode('spc:LaserGreen13', parent=self)
mlasers.position = self.ship.position + (10, 30)
mlasers.z_position = -1
actions = [A.move_by(500, self.size.h, 1.3 * self.speed), A.remove()]
mlasers.run_action(A.sequence(actions))
self.mlasers.append(mlasers)
def laser_multi(self):
mlasers = SpriteNode('spc:LaserGreen13', parent=self)
mlasers.position = self.ship.position + (10, 30)
mlasers.z_position = -1
actions = [A.move_by(-500, self.size.h, 1.3 * self.speed), A.remove()]
mlasers.run_action(A.sequence(actions))
self.mlasers.append(mlasers)
As you can see I made one function for each of the two lasers (only way for me to get it to work)
Im greatful for any help or tips
//
B