• janaaron97

    Thank you guys very much. That helps!

    posted in Pythonista read more
  • janaaron97

    I would like for someone to show me how to combine these two scenes into one:

    from scene import *
    class dumb (Scene):
        def setup(self):
            self.x = self.size.w * 0.5
            self.y = self.size.h * 0.5
        def draw(self):
            background(0.00, 0.00, 0.00)
            fill(1.00,1.00,1.00)
            g = gravity()
            self.x += g.x * 10
            self.y += g.y * 10 
            self.x = min(self.size.w - 100, max(0, self.x))
            self.y = min(self.size.h - 100, max(0, self.y))
            ellipse(self.x,self.y,100,100)
    
    
    
    class real (Scene):
        def setup(self):
            self.x = self.size.w * 0.4
            self.y = self.size.h * 0.4
        def draw(self):
            background(0.00, 0.00, 0.00)
            fill(1.00,1.00,1.00)
            g = gravity()
            self.x += g.x * 10
            self.y += g.y * 10 
            self.x = min(self.size.w - 100, max(0, self.x))
            self.y = min(self.size.h - 100, max(0, self.y))
            rect(self.x,self.y,100,100)
    
    
    run(dumb())
    run(real())
    

    posted in Pythonista read more
  • janaaron97

    I'm trying to use the example program that discusses the gravity() function in Pythonista to learn the "scene" library.

    What I want to do is have a square and a circle move around on the screen when I tilt the phone, at the same time. However, right now, there is only one shape.

    How do I get both shapes to move on the screen?

    Heres the code

    from scene import *
    class dumb (Scene):
        def setup(self):
            self.x = self.size.w * 0.5
            self.y = self.size.h * 0.5
        def draw(self):
            background(0.00, 0.00, 0.00)
            fill(1.00,1.00,1.00)
            g = gravity()
            self.x += g.x * 10
            self.y += g.y * 10 
            self.x = min(self.size.w - 100, max(0, self.x))
            self.y = min(self.size.h - 100, max(0, self.y))
            ellipse(self.x,self.y,100,100)
            
            
    
    class real (Scene):
        def setup(self):
            self.x = self.size.w * 0.4
            self.y = self.size.h * 0.4
        def draw(self):
            background(0.00, 0.00, 0.00)
            fill(1.00,1.00,1.00)
            g = gravity()
            self.x += g.x * 10
            self.y += g.y * 10 
            self.x = min(self.size.w - 100, max(0, self.x))
            self.y = min(self.size.h - 100, max(0, self.y))
            rect(self.x,self.y,100,100)
    
            
    run(dumb())
    run(real())
    

    Thank you!

    posted in Pythonista read more
  • janaaron97

    Is this what you meant?

    from scene import *
    class dumb (Scene):
        def setup(self):
            self.x = self.size.w * 0.5
            self.y = self.size.h * 0.5
        def draw(self):
            background(0.00, 0.00, 0.00)
            fill(1.00,1.00,1.00)
            background(0.00, 0.00, 0.00)
            fill(1.00,1.00,1.00)
            g = gravity()
            self.x += g.x * 10
            self.y += g.y * 10
            self.x = min(self.size.w - 100, max(0, self.x))
            self.y = min(self.size.h - 100, max(0, self.y))
            ellipse(self.x,self.y,100,100)
            rect(self.x,self.y,100,100)
    run(dumb())
    

    I tried that and it didn't work.

    posted in Pythonista read more
  • janaaron97

    How do I put both shapes into the same scene?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!