• Bjucha

    @omz thank you very much!!! Gonna try it

    posted in Pythonista read more
  • Bjucha

    Hi
    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

    posted in Pythonista read more
  • Bjucha

    @JonB yes, I want the ship to "die" if it touches the explosion, gonna try your solution when I get home, thank you

    posted in Pythonista read more
  • Bjucha

    @ccc thanks for the help, but I stll don't get it to work maybe I have forgotten something else. Anyhow thank you for your help will look through it all again

    posted in Pythonista read more
  • Bjucha

    Hi everybody.

    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?

    posted in Pythonista read more
  • Bjucha

    Hello again!

    Game update:

    • 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)

    Link to game: https://gist.github.com/bjucha81/c4d369fc53e8a31ede218a5476116fa2

    ToDo:

    • Add new enemies
    • Add final boss or more bosses
    • more power-ups
    • Start up screen/ end screen

    posted in Pythonista read more
  • Bjucha

    @ccc so sorry didn't see your whole response, That got it to work thank you very much!!!

    posted in Pythonista read more
  • Bjucha

    @ccc Yes been looking at that but the problem is the X,Y coordinates, seems not to accept self.ship.position as X,Y values if I use regular numbers it works
    Guessing the problem is that self.ship.position has both x,y coordinates in it so the A.move_to can't read it.

    posted in Pythonista read more
  • Bjucha

    Hello.
    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?

    Thank you

    posted in Pythonista read more
  • Bjucha

    thanks for all the suggestions, Ithoughts sounds interesting

    posted in General Discussion read more

Internal error.

Oops! Looks like something went wrong!