• Bjucha

    @cvp Thank you, that did the trick!!!

    posted in Pythonista read more
  • Bjucha

    @cvp thanks but now it says that ’main_view’ is not defined. When pressing the button.

    posted in Pythonista read more
  • Bjucha

    Hello I have added a ui.view on my scene that is displayed when my game starts, and at the same time the Scene.Paused = True condition is activated. Here is The problem I want a button that when presse closes the ui.view using ui.view.close and starts the scene, however I cant get the ui.view.closee to work. I always get that main_view (name of the ui.view) is not defined in the button pressed function. I here is the code ```
    class view (ui.View):
    main_view = ui.View(name = 'Killer Aliens From Space!')
    main_view.present(title_bar_color = 'grey')

    def startup(sender):
        Scene.paused = False
        ui.View.close(main_view) # Here is where it complains
    b1 = ui.Button(title = "Start")
    b1.frame = (295,390,190,50)
    b1.background_color = '#b03206'
    b1.corner_radius = 15
    b1.tint_color = 'blue'
    b1.action = startup
    Any ideas why this is happening?

    posted in Pythonista read more
  • Bjucha

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

    posted in Pythonista read more
  • Bjucha

    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)]
            if mini.position == (300,300):
                action2 = [A.move_to(x +10,y + 20, 1.5)]
    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:
            explode.run_action(A.move_by(10, 10, 1.6, TIMING_EASE_OUT))
            explode.run_action(A.sequence(A.wait(1), A.remove()))       

    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


    • 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

Internal error.

Oops! Looks like something went wrong!