omz:forum

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

    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 6
    • Posts 21
    • Best 0
    • Controversial 0
    • Groups 0

    Vile

    @Vile

    0
    Reputation
    725
    Profile views
    21
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    Vile Unfollow Follow

    Latest posts made by Vile

    • RE: Xcode template not working for building to iPhone running iOS 13.3.1

      Used the Xcode beta, set the target to iOS 13.3, same issue.

      posted in Pythonista
      Vile
      Vile
    • Xcode template not working for building to iPhone running iOS 13.3.1

      When I try to run the app from my iPhone's home screen, it keeps crashing. I keep getting the following error: 'Thread 1: signal SIGABRT'

      Does anyone know how to fix this?

      I have selected the deployment target for iOS 13.2 because in the drop down menu none were available for 13.3.1

      posted in Pythonista
      Vile
      Vile
    • dismissing modal scenes?

      Is there a way of selecting which modal scenes I want to dismiss while keeping other modal scenes running? This would be very helpful in game development (for example, you may have two different menus open at the same time, but you only want to close one of them).

      posted in Pythonista
      Vile
      Vile
    • RE: Sprite animation from sprite sheet at 8 FPS?

      @JonB and @cvp, thanks once again! It seems to work in the way I expected now.

      It seems that scene.t uses a different time frame from time.process_time, because with the same number value, the animations appear to go at different speeds.

      posted in Pythonista
      Vile
      Vile
    • RE: Sprite animation from sprite sheet at 8 FPS?

      @JonB, I tried using scene.t and scene.dt, but I can’t get it working...

      posted in Pythonista
      Vile
      Vile
    • RE: Sprite animation from sprite sheet at 8 FPS?

      Wait it actually works, I just had the wrong indentation on the update function XD

      Here’s the code:

      from scene import *
      import time
      
      sprite_sheet = [
      Texture('IMG_0227.png').subtexture(Rect(0,0,0.25,1)),
      Texture('IMG_0227.png').subtexture(Rect(0.25,0,0.25,1)),
      Texture('IMG_0227.png').subtexture(Rect(0.5,0,0.25,1)),
      Texture('IMG_0227.png').subtexture(Rect(0.75,0,.25,1)),
      ]
      
      class MyScene (Scene):
      	def setup(self):
      		self.screen="game"
      		self.background_color = 'black'
      		self.last_update = time.process_time()
      		self.sprite = SpriteNode(sprite_sheet[0],
      		scale = 1,
      		position = self.size / 2,
      		parent = self)
      		self.add_child(self.sprite)
      		self.n=0
      		
      	def update(self):
      		#self.sprite.texture=sprite_sheet[1]
      		current_time = time.process_time()
      		if current_time - self.last_update > 0.05:
      			self.last_update = current_time
      			#modify_the_sprite
      			self.sprite.texture=sprite_sheet[self.n]
      			self.n=self.n+1
      			if self.n > 3:
      				self.n=0
      run(MyScene())
      

      Thanks a lot for your help!

      posted in Pythonista
      Vile
      Vile
    • RE: Sprite animation from sprite sheet at 8 FPS?

      @pulbrich

      I tried your method, but it seems that anything I put into the update function doesn’t get used...

      Here’s the updated code:

      from scene import *
      import time
      
      sprite_sheet = [
      Texture('IMG_0227.png').subtexture(Rect(0,0,0.25,1)),
      Texture('IMG_0227.png').subtexture(Rect(0.25,0,0.25,1)),
      Texture('IMG_0227.png').subtexture(Rect(0.5,0,0.25,1)),
      Texture('IMG_0227.png').subtexture(Rect(0.75,0,.25,1)),
      ]
      
      class MyScene (Scene):
      	def setup(self):
      		self.screen="game"
      		self.background_color = 'black'
      		self.last_update = time.process_time()
      		self.sprite = SpriteNode(sprite_sheet[0],
      		scale = 1,
      		position = self.size / 2,
      		parent = self)
      		self.add_child(self.sprite)
      		n=0
      		
      		def update(self):
      			current_time = time.process_time()
      			if current_time - self.last_update > 0.125:
      				self.last_update = current_time
      				#modify_the_sprite
      				self.sprite.texture=sprite_sheet[n]
      				n=n+1
      run(MyScene())
      
      posted in Pythonista
      Vile
      Vile
    • RE: Sprite animation from sprite sheet at 8 FPS?

      @JonB, I’ve also never used Action.wait before, so I’d appreciate an example of this, thanks.

      Remember, I’m still a noob here lol

      posted in Pythonista
      Vile
      Vile
    • RE: Sprite animation from sprite sheet at 8 FPS?

      @JonB, I’ve already looked at the game tutorial, where it showed how to animate a walking sequence. However, that method only works when the sprite is changing its position in pixels on the screen, so it will not work for my sprite. This is because my sprite’s position is constantly at the centre of the screen.

      The effect I’m trying to achieve is basically a GIF with a customisable frame speed, which is permanently in exactly the same position at the centre of the screen.

      posted in Pythonista
      Vile
      Vile
    • RE: Sprite animation from sprite sheet at 8 FPS?

      @pulbrich, could you give an example of how to check that the correct amount of time has passed?

      posted in Pythonista
      Vile
      Vile