• Splefix

    Yes, but it is okay. I will just use the time module instead. Thank you all for your help. God bless you all in Jesus Christ’s MIGHTY NAME!!!!

    posted in Pythonista read more
  • Splefix

    @mikael Hey man, I did that, but now I get the following error:

    • Name 'script' is not defined

    This concerns the following code:

           @script
        def do_a_thing_every_second(self):
            if self.auto_amount >= 1:
                while(True):
                    spawn_bubble(self, False)
                    yield 1.0
    

    posted in Pythonista read more
  • Splefix

    @mikael Hey sorry man, I am new to Pythonista, especially concerning the installation you are talking about. Can you please help me install scripter? If it isn’t too much trouble. I haven’t worked with github before either.

    posted in Pythonista read more
  • Splefix

    @mikael Hi friend, I am having trouble with importing scripter? It says that this is invalid syntax:

    from scripter import *
    

    posted in Pythonista read more
  • Splefix

    @JonB Concerning your question above: Can you show me how to update the text? This is my first time using the scene module.

    Also, say I have two args, and the function is out of the MyScene class: How would I tackle this?

    posted in Pythonista read more
  • Splefix

    @JonB Hey, can I ask you to show me an example of calling a method containing args using the example you gave me above?

    posted in Pythonista read more
  • Splefix

    @musicman305 Haha brother, God just helped me figure that out myself! Thank you very much though for your answer! God bless you abundantly and may peace be with you!!!

    Nice meeting you brother!

    posted in Pythonista read more
  • Splefix

    @JonB

    Here is the code for the update subclass:

        def update(self):
            self.score_label.run_action(Action.remove())
            self.goal_label.run_action(Action.remove())
            self.score_label = LabelNode(str(f'Score: {self.score}'), ('Arial Rounded MT Bold', 33), position=(self.size.x/2, (self.size.y/1)-133))
            
            self.goal_label = LabelNode(f'Goal: {self.goal}', position=(self.size.x/2, ((self.size.y/1)-133)+50))
            
            self.add_child(self.score_label)
            self.add_child(self.goal_label)
            
            if self.auto_amount >= 1:
                spawn_bubble(self, False)
            
            if self.chest_visible == True:
                if self.score >= self.goal:
                    buy_automate_chest = SpriteNode('plc:Chest_Open', position=(self.size.x/2, self.size.y/5), parent=self)
                    
                    self.chest_location = buy_automate_chest.frame
                else:
                    buy_automate_chest.run_action(Action.remove())```

    posted in Pythonista read more
  • Splefix

    Basically, I want to add a point every 1 second automatically if a statement is currently true. How can I do this?

    posted in Pythonista read more
  • Splefix

    @cvp Yield causes the LabelNodes to disappear, and other code seems to stop working when using it in the scene.update function. Do you maybe know why?

    posted in Pythonista read more
  • Splefix

    Okay so I learnt that you can get the frame of a SpriteNode. Say that your sprite is moving in random directions like an AI finding paths. Now take the frame of the SpriteNode:
    E.g:

    def setup(self):
        trap = SpriteNode('sprite', position=self.size/2)
        AI = SpriteNode('sprite', position=self.size/3
        trap_location = trap.frame
        self.add_child(AI)
        self.add_child(trap)
    

    Now in the update function, check if the location of the AI is in the location of the trap:
    E.g:

    def update(self):
        if (self.AI.frame.x and self.AI.frame.y) in trap_location:
            # Do the rest of your code here.
    

    posted in Pythonista read more
  • Splefix

    Hi, I want to know if it is possible to call a method every n seconds (example: every 1 second) in scene.update.

    If this is possible, can you please provide the right way of going about this?

    Thank you, and God bless you all abundantly in Jesus Christ!!!

    posted in Pythonista read more
  • Splefix

    @JohnB
    Thanks for your reply on this! I uninstalled some packages I don’t know about, and now it has started to work once again!

    God bless you abundantly friend!

    posted in Pythonista read more
  • Splefix

    Just to add, here is a link to a screenshot of the pip error.

    posted in Pythonista read more
  • Splefix

    So, Pythonista 3 has been working for me until this evening. It just out of the blue stopped working, giving me the following error:

    • No module named ‘httplib’

    Each time I tried to use pip via launch_stash, it gives me the above error aswell. Can you please help me figure out what the problem is, and if you can find a solution to this problem I’m facing?

    posted in Pythonista read more
Internal error.

Oops! Looks like something went wrong!