Im having a problem with getting my SpriteNode to move several times
Moving it from one place to an other is no problem but if I would like it to make a new movement when the first one is complete it will not work
This is how I tried:
def mini_attack(self, boss3): mini = Mini(parent=self) mini.position = boss3.position x,y = self.ship.position action = [A.move_to(300,300, 1.5)] mini.run_action(A.sequence(action)) mini.remove_action(A.sequence(Action)) if mini.position == (300,300): action2 = [A.move_to(x +10,y + 20, 1.5)] mini.run_action(A.sequence(action2)) ``` it's the action2 that will not happen... Appreciate any help
I have a problem with a function and Im wondering if anybody can help me with it
I have create "Bombs" that explode if you shot them, however my issue is that I would like the ship to die if it touches the explosion and I thought that it should look something like this for it to work:
def bomb_gone(self, bomb): explode = SpriteNode('shp:Explosion00', parent=self) explode.scale = 0.5 explode.position = bomb.position if self.ship.position == explode.frame: exit() explode.run_action(A.move_by(10, 10, 1.6, TIMING_EASE_OUT)) explode.run_action(A.sequence(A.wait(1), A.remove())) bomb.remove_from_parent()
as you can see if the ships and explode occupies the same frame the game is over, but it does not work, it works if the "bomb" has not exploded and I fly right into it but not if they explode, any suggestions?
- Power-up works fine now (They do not work on bosses)
- Added second boss
- Fixed some issues with enemy lasers and boss lasers
- Added score (Just for fun)
- Add new enemies
- Add final boss or more bosses
- more power-ups
- Start up screen/ end screen
@ccc Yes been looking at that but the problem is the X,Y coordinates, seems not to accept
self.ship.positionas X,Y values if I use regular numbers it works
Guessing the problem is that
self.ship.positionhas both x,y coordinates in it so the
A.move_tocan't read it.
im trying to create a laser/missle that fires at the player ship position. But im getting type error: A float is required. When using the following
actions = [A.move_to(self.ship.position, self.ship.position, 2 * 2), A.remove()]
Is it possible to convert the self.ship.position to float somehow or is it an orher way to do it?