• mwsx

    I have way more things acting in my scene and everything’s running fine, everytime I saw a dropped in FPS it was becauseI did something wrong not because of any limitations. Maybe you're instantiating things in a loop or maybe you just have a print in update which makes the FPS drop pretty fast also.
    Also do you remove the meteors from their parent once they get destroyed ?
    If you could paste the meteor code I could check what’s the problem

    posted in Pythonista read more
  • mwsx

    Here is my star method if you want.

    
        def instantiate_star(self):
            self.star = SpriteNode('white_circle_2.png')
            self.star.z_position = random.choice([-1,0,2])
            self.star.alpha=0
            self.star.scale =0.01/2
            self.star.position = (random.uniform(0,self.size.w), random.uniform(0,self.size.h))
    
            self.star.rotation= (random.uniform(0,360))
            d = random.uniform(0.5, 1)
            i = random.uniform(3,6)
            j = random.uniform(2,5)
            actions = [A.scale_by(random.uniform(0,0.01), i), A.fade_to(d,i), A.scale_to(random.uniform(0.02,0.0), j),A.fade_to(0,j),A.remove()]
            self.star.run_action(A.sequence(actions))
            self.starNode.add_child(self.star)
        
        
    
          
    

    You’ll just have to replace the sprite with some white circle image

    posted in Pythonista read more
  • mwsx

    Not sure what you’re stuck on but if you want to animate your background to give the impression of life what you really want to do is not animate the background itself but the children sprites that you will add into your background node.

    So if you want to twinkle little stars in your background, you will create your star spriteNode and add it as a child of your background node and run an action :move,rotate,scale etc.

    if you really want to animate the background and not objects that are on it then it’s all the same since background it’s a spritenode.

    About the image quality i don’t think it should be a problem to load a big image, it’s just one image.

    posted in Pythonista read more
  • mwsx

    Ok I believe my problem came because I wanted to move the player where I should be moving the background like you said instead. I didn’t really grasp what a scene was until now. Thx to the both of you I think I’ll be ok now.

    posted in Pythonista read more
  • mwsx

    @mikael Hey, yes I ran your code and I don’t understand how I can use it in my context, but I don’t understand anything anymore anyway so I’ll try to explain:

    • I have a scroll view that has a background image with the same size, which is gonna be my map (which the player is be able to drag trough )

    -I need the scene basically to instantiate and animate stars and particles etc.

    • I want those stars to instantiate and animate to the entire area of the scrollView, not only to my scene bounds. I also need the scene background to be transparent so only the stars are visible and the background image of my scrollview not the bg of sceneview.

    -then I have my player that is also part of my scene because it has animations.

    -And a joystick that controls the player position relative to the scrollview area and not the sceneview but it has to keep its own position relative to the sceneview.
    So I’m really confused af now because I tried every combination and nothing seems to work together because of the parent/child relations between them. I know I’m missing something super simple I’m just so frustrated I can’t see it..

    So if you know how it’s done to have of all that working together in a simple way I’d greatly appreciate it. Like I want a basic map size of my choice where the player move freely relative to the background but still being at the Center of the screen as if there was a camera following him. I tried so much things that lead to nowhere that I’m in apathy mode now you guys are my last hope <3

    posted in Pythonista read more
  • mwsx

    Ok thanks that kinda make sense I had to use every trick to make my scene move around and give the illusion of player moving freely in an infinite map I didn’t know there was such thing as scroll view I’ll check about that too.

    Edit: yeah scroll view is actually what Ive been trying to create myself thinking there was no such thing implemented..so thanks this will make me gain a lot of time :))

    posted in Pythonista read more
  • mwsx

    I do need my view to be bigger.
    I just Need to know why are sceneview's bounds limited to 2048 and if it's fixable.
    I really can’t find any info about this anywhere it's driving me crazy ^^
    I could paste the code but I can’t really strip it I mean I can but it’s still gonna be big and messy and it wouldn’t answer why 2048 and not 2049 ;(

    posted in Pythonista read more
  • mwsx

    Hello, I finally created an account out of frustration, I’m building a game and I want my view's bounds to be bigger than 2048 but whenever I set it to anything more than 2048 everything in my scene disappear and I’m left with a black square. Is it some rendering limitation or am I missing something ?

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!