omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular
    1. Home
    2. flight_714

    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.


    • Profile
    • Following 0
    • Followers 0
    • Topics 0
    • Posts 2
    • Best 0
    • Controversial 0
    • Groups 0

    flight_714

    @flight_714

    0
    Reputation
    622
    Profile views
    2
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    flight_714 Unfollow Follow

    Latest posts made by flight_714

    • RE: fps drops rapid when "boss" SpriteNode appears

      I realize this is a few weeks old, but had a few thoughts.

      I typically add scene objects of a shared type to a list and then iterate over a method of their class in update.

      So at the end up the enemy class init I would add 'enemies.append(self)' and then in the scene update method add 'for enemy in enemies': enemy.cooldown() or something to that to that effect.

      Obviously, you'd have to write a bit more AI methods for the enemy ships, so you'd probably want to subclass them to save space.

      posted in Pythonista
      flight_714
      flight_714
    • RE: Timer method for scene?

      Full disclosure: I'm a perpetual noob both with Pythonista and programming in general, but I have wrestled with this issue quite a few times tooling around with game ideas.

      The simplest solution is to set up a manual timer that uses the Scene update method to subract a number from a starting point.

      Ex:
      [scene setup code]
      self.timer = 100

      def update(self):
      self.timer -= 1
      if self.timer <= 0:
      self.timer = 100
      do_something()

      Obviously, once this makes sense you can make a timer class and have multiple instances running for different events.

      Alternatively, you can mess around with threading, but I've found that this route is best for simpler tasks.

      Obviously, frame rate is an issue and I'm sure the more experienced folks around here will have a more elegant solution.

      posted in Pythonista
      flight_714
      flight_714