• FarmerPaco

    I would gladly pitch in for a crowdfunding project. I am sure there are a lot of experienced users with lots of great projects that would shine a little on how to make the most out of this amazing app.

    posted in Pythonista read more
  • FarmerPaco

    @abcabc thanks a lot. One of the amazing thing about these forums is that people (like you) help out with great examples and no snark. I am really grateful. And hopefully when I have greased my wheeels a bit more I will also be to help others out.

    So thanks again for pointing out my mistake.
    The polygon you included also really helps understand the syntax better!

    posted in Pythonista read more
  • FarmerPaco

    So I am playing around with the Game Module and I have enjoyed swapping out coins for snowflakes and then slowed them down for a beautiful snowy day, but I want to do this with a ShapeNode and can't seem to figure it out..

    class Coin (SpriteNode):
        def __init__(self, **kwargs):
            
            SpriteNode.__init__(self, 'emj:Snowflake', **kwargs)
    

    If anyone can point me in the right direction to use a circle (ui.Path.oval) instead of a texture.
    It tried this

    class Ball(ShapeNode):
        def __init__(self, **kwargs):
            
            circle = ui.Path.oval (0, 0, 20, 20)
                    
            theball = ShapeNode(circle,'red', stroke_color='clear', shadow=None)
            
            ShapeNode.__init__(self, theball, *kwargs)
    

    And it tells me the ShapeNode object has no attribute bounds.
    Thanks in advance to anyone who can help.

    posted in Pythonista read more
  • FarmerPaco

    Always grateful for each update. I use this app for education. Each update means I have a better and more powerful learning tool for my students.
    Thanks a million.

    posted in Pythonista read more
  • FarmerPaco

    Do you mind posting the final script with the changes. I would love to see how it turned out.
    Thanks in advance.
    farmerPaco

    posted in Pythonista read more
  • FarmerPaco

    Thank you Ole, this is what I was looking for, and thank you especially for taking time to answer bye so I can see the difference.

    I want to mention that I use your app at a code school in Matsumoto, Japan. Until now I have taught with a block code app called Hopscotch but we needed to move up and I decided Python over Ruby. Your app makes it possible to learn Python on iPad.

    I am very grateful for this. Your app is a huge win for education!

    posted in Pythonista read more
  • FarmerPaco

    @Phuket2 Thanks for the guidance. I made a simpler version which runs smoothly, but I am still using Scene. Was hoping someone could show me or point me in a better direction.

    This is the improved version tha doesn't choke on memory.

    from scene import *
    import time
    import colorsys
    colors = []
    
    for i in range(0, 100, 1):
        b = i / 100.0
        color = colorsys.hsv_to_rgb(0.56, 0.88, (b))
        colors.append(color)
    
    
    i = 0
    class sunsetScene(Scene):
        def setup(self):
            # get starting time
            self.start_time = time.time()
            global i
            self.background_color = 'black'
            
        def update(self):
            global i
            # update background color after .1 seconds
            if time.time() - self.start_time > .1:
                
                self.background_color = colors[i]
                if i <  (len(colors)-1):
                    i+=1
                self.start_time = time.time()
                
                
    main_view = SceneView()
    main_view.scene = sunsetScene()
    main_view.present(hide_title_bar=True, animated=False)```

    posted in Pythonista read more
  • FarmerPaco

    Okay, so I tried to work it out, and it does work but I know there is a better way. Any hints? Please help.

    Here is my last version:

    from scene import *
    import time
    import colorsys
    colors = []
        
    for i in range(0, 100, 1):
        b = i / 100.0
        color = colorsys.hsv_to_rgb(0.56, 0.88, (b))
        colors.append(color)
        print(color)
    
    
    
    i= -1
    class sunsetScene(Scene):
        def setup(self):
            # get starting time
            self.start_time = time.time()
            global i
            if i <  (len(colors)-1):
                i+=1
            SpriteNode(anchor_point=(0, 0), color= colors[i], parent=self,
                       size=self.size) 
            
        def update(self):
            # move to new scene after 2 seconds
            if not self.presented_scene and time.time() - self.start_time > .2:
                self.present_modal_scene(sunsetScene())
                
    main_view = SceneView()
    main_view.scene = sunsetScene()
    main_view.present(hide_title_bar=True, animated=False)
    

    posted in Pythonista read more
  • FarmerPaco

    Hi, I am very new at this. I am trying to get a sunset background, preferably using a HSB with dwindling value of the brightness.

    I have tried just importing time using Range and Sleep which of course didn't work.

    I tried with the code below to at least transition with delay from one color to another but can't seam to figure it out delay. Surely there is a simple way to create sunset where I get blue background to transition to black while leaving a Sprite alien to watch it.
    Please help. I learn best from examples. I believe I am supposed to use action delay but would really appreciate if someone could show me an example of code that transitions color in the background so I can understand it better. Thanks in advance.

    from scene import *
    import time

    class FirstScene(Scene):
    def setup(self):
    self.start_time = time.time()
    SpriteNode(anchor_point=(0, 0), color='white', parent=self,
    size=self.size)

    def update(self):
        newColor = ['blue','green']
        if not self.presented_scene and time.time() - self.start_time > 2:
            SpriteNode(anchor_point=(0, 0), color= newColor[0], parent=self,
                   size=self.size)
            self.start_time = time.time()
        if not self.presented_scene and time.time() - self.start_time > 2:
            SpriteNode(anchor_point=(0, 0), color= newColor[1], parent=self,
                   size=self.size)
    

    main_view = SceneView()
    main_view.scene = FirstScene()
    main_view.present(hide_title_bar=True, animated=False)

    posted in Pythonista read more
  • FarmerPaco

    @pat31700 your script works great! Once added as an extension you can pull from any app actually. I use iFiles as my go between apps since it stores to cloud or any cloud service, and once in the cloud it can be had anywhere.
    I work with young students and we use cloud storage as a centralized classroom to share and learn from each other so this solution works nicely for them to import each other's work.
    So thank you.

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!