• It worked!!
    I could stop Action.repeat().
    Thank you so much!!

  • And try the last script of this topic to get a Blurr effect.

  • @resserone13, for your app, this could work really well:


  • I put this code under touch_began() and its how I want. Every time the button is clicked the amount of taps is checked and if it meets the condition it adds 15 to the time.

    if self.tap_count % 20 == 0 and self.tap_count != 0: self.timer_value += 15
  • @mikael ok. That’s a good idea. I’ll add some.

  • @JonB thanks. I defined everything and added the music code and it’s stopping and starting on cue. Thank you for your help. I wasn’t sure how to use the stop resume and pause. I sometimes still have trouble figuring out little things.

  • @JonB Thank you for the advice. I’m going to try to work this in. I am also going to review all of my post to make sure I haven’t missed any advice. I really appreciate you guys helping me. I’ve seen some things you guys have worked on on github and it is much above my level. I appreciate you guys taking the time to help me. I feel it’s a privilege to be helped by people who know so much. Thank you very much @mikael @ccc @cvp.

  • @cvp I’ve got it to work with all the other sound effects by using the sound.playeffect(). I think there might be a problem when you use sound.player() with sound.playeffect(). This is what I’m using.

    class MainScene (Scene): def setup(self): bg_music = sound.play_effect('3 card monte beat (90.00 BPM) - MAIN OUT.wav', volume=.25) bg_music.looping = True
  • @resserone13 This was helpful. Was having difficulty with creating delays and this cleared it up. Thanks for the pointer. Cheers.

  • @ccc would something like this be a good idea?

    position = (self.size.w/2, self.size.h * 1.60)

    If not would be so kind to so me the proper way.

  • @resserone13, it is a feature of scene that in the setup method we already know the size. Very convenient when compared to the ui module.

  • @trey, one idea would be to place a transparent view on top (as a subview of scene.view) to handle the touches.

    Then you would need to check if the touch is near the top-right corner to simulate clicking on the ”x” with superview.close(). And remember to flip the y coordinate before passing the coordinate and touch type to your scene code. And maybe go via screen coordinates if you do a lot of zooming and panning in your scene.

  • Sounds great! Looking forward to it.

  • Thanks guys, I will study about shader and effect more Thanks!

  • @Tonnoaw I would also try to import game_menu.py and build a menu with title and option selection buttons. So, rather than setting “cheat” mode in the script, define a mode button for a non-programmer to change mode of operation.

  • My current approach is to load the tileset.png which contains all the tiles. I then use Image.crop() for every tile I want to extract. I then upscale them using Image.resize() by some arbitrary factor, because if I would let the scene upscale the 8x8 textures to something like 64x64, the performance drops hard. Using BytesIO I convert them to ui.Image without saving them on disk and from there I can load them as a scene.Texture.

    But thank you for the hint that I can load the image and scale them in one operation!

    All I had to do to fix the original problem was converting the tileset.png to RGB mode.

  • @mikael lol well ive never checked the memory lol so in theory this is what i expect lol

  • @stephen 👍

  • @cvp - that’s a tremendous help, many thanks.

    For anyone who might want help with ui and scene path drawing when searching in the future, here’s the complete working code (when using the ‘new’ render loop not the classic render loop):

    import ui from scene import * class MyScene (Scene): def setup(self): self.background_color = '#00006b' self.centre = Point(self.size.w/2, self.size.h/2) def update(self): pass def touch_began(self, touch): # Calculate vector between centre point and touched point dx = touch.location.x - self.centre.x dy = touch.location.y - self.centre.y # Draw path from centre point to touched point path = ui.Path() path.line_width = 4.0 path.move_to(-dx,dy) path.line_to(-dx,dy) path.move_to(0,0) path.line_to(dx,-dy) # Create line node from path line = ShapeNode() line.path = path line.position = (self.centre.x, self.centre.y) line.stroke_color = 'white' self.add_child(line) # Place dots at centre and touch points dotA = Dot(location = self.centre) self.add_child(dotA) dotB = Dot(location = touch.location) self.add_child(dotB) class Dot(ShapeNode): def __init__(self, *, location, **kwargs): circle = ui.Path.oval(0,0,20,20) super().__init__(circle, fill_color='white', **kwargs) self.position = (location.x, location.y) run(MyScene())
Internal error.

Oops! Looks like something went wrong!