Well, I'm in my mid 50's so quite possibly an oldie compared to many of the members here... but I am thoroughly enjoying learning about coding etc. I love photography and synthesisers, too!!
By all means reach out and say hi!
Current project: trying to write a Connect4 game using Pythonista on the iPad
IDE: PyCharm for OSx
-
themusicman
@cvp Aha... many thanks, didn't think of that! Guess there's my answer right there, eh 😀
-
themusicman
@Dabfrica Hey, how are you doing? I just read your post, OK nearly a full year after you posted it, and was curious as to how you are getting on. Let us know...
-
themusicman
You can also use iCloud to share / move your Pythonista files between your iPhone, iPad and Mac. 👍
-
themusicman
Thanks @jonb much appreciated. I’ve now managed to get the webIDE up and running, too!
So, I have done some stuff using the spritenode system, and managed to pretty much successfully (well at least for me!) to get a version of connect4 coded and working using the default game/animation template as the start. However, I couldn’t find any way of drawing a simple line... surely I am missing something here Jon, and one should easily be able to do that somehow? Any pointers?
-
themusicman
Thanks @cvp - when I checked originally, after adding the files via the method you describe, I wasn't seeing any files in the +, images, files area. However, and very typically... when I checked immediately after reading your last reply they are indeed there.
Thanks again.
-
themusicman
@cvp said:
When you use the bottom right + button, you don’t import the icon but only it’s name that you can use as ui.Image. named(‘xxx’)
Aha... thanks for the clarification. Is there a way one can add to the library of images/sounds etc available within Pythonista?
I am not planning on using he UI module in this particular script, but have found a way of displaying and possibly using an image for a screen background using the PIL image library.
-
themusicman
So @cvp - I have done this but I am not sure where the image I allegedly imported has been stored within Pythonista. When I try to select that image as I would for any image selection, the image does not appear anywhere.
So, say I want to use 'emj:Black_Circle' as an image, when I click the bottom right to get the Pythonista dialogue box for adding new image / sound / colour / font etc, the image I just imported is nowhere to be found.
Specifically, I want to add an image from my photo library to use as the background image for a Pythonista app.
Am I doing this correctly?
-
themusicman
Hi All
So I am trying to draw a simple line in Pythonista. I have selected a new game type template and the documentation states;
scene_drawing — Drawing Functions for the scene module The functions in this module can be used within the scene.Scene.draw() method when using the classic render loop mode of the scene module.
The default game/animation template is thus;
from scene import * import sound import random import math A = Action class MyScene(Scene): def setup(self): pass def did_change_size(self): pass def update(self): pass def touch_began(self, touch): pass def touch_moved(self, touch): pass def touch_ended(self, touch): pass if __name__ == '__main__': run(MyScene(), show_fps=False)
From the documentation I think I need to set up a def draw(self): function, but I am not sure what the documentation means when it refers to the scene.Scene.draw() method when using the classic render loop mode of the scene module.
Could someone help explain the syntax of what I need to include where please. Many thanks.
-
themusicman
@Splefix said:
@themusicman 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!
You're very welcome matey...
-
themusicman
@Splefix - specifically for your example...
# you will need the time module, so... import time # set the variable for your single timer last_task1=time.time() # then execute task1 every 1 second if 'your_statement' is true if your_statement == True: if time.time()-last_task1>=1: # run whatever code you need to execute every 1 second here # put your code for task1 here # then reset the timer for this task1 last_task1=time.time()