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!!!!
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Splefix
@Splefix
I am a disciple of Christ Jesus the Lord and Saviour!!!
Best posts made by Splefix
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
-
RE: How to get a SpriteNode to change image / colour on screen-touching another Sprite?
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.
-
RE: [SOLVED] No module named ‘httplib’.
@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!
Latest posts made by Splefix
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
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!!!!
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
@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
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
@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.
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
@mikael Hi friend, I am having trouble with importing scripter? It says that this is invalid syntax:
from scripter import *
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
@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?
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
@JonB Hey, can I ask you to show me an example of calling a method containing args using the example you gave me above?
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
@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!
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
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())```
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
Basically, I want to add a point every 1 second automatically if a statement is currently true. How can I do this?
-
RE: [SOLVED] Calling methods every n seconds in scene.update()
@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?