• lance1994

    @ccc

    For the collision I still had to set a player_hitbox Rect() for it to intersect with the rock , if you look above you'll see my rock code . I tried the

    self.frame.intersects(item.frame)

    But that doesn't work any idea guys?

    posted in Pythonista read more
  • lance1994

    Okay Guys Something New Here Is The Code

    class Rock(SpriteNode):
     def __init__(self, **kwargs):
            SpriteNode.__init__(self, 'IMG_1726.GIF', **kwargs)
    
    def update (self): 
     
     self.spawn_rock 
    
    
    
    class Rock(SpriteNode):
     def __init__(self, **kwargs):
            SpriteNode.__init__(self, 'IMG_1726.GIF', **kwargs)
    

    It does what it's suppose to do spawn the rocks, but I want it to spawn 3 rocks at a time. After each rock is destroyed it is randomly generated somewhere else. Not immediately but like a 10 second duration. I tried if and else statements in the update but nothing seems to work , going to keep poking around any input ?

    posted in Pythonista read more
  • lance1994

    Got everything up and running , it was a indention problem.

    posted in Pythonista read more
  • lance1994

    Okay guys so everything works but now my touch movement for my Sprite isn't responding here's the original code before I implemented your code ,

            x, _= touch.location
            _, y = self.player.position
            move_action = Action.move_to(x,y,2,TIMING_SINODIAL)
            self.player.run_action(move_action)
            if (x,_ > 0.05):
                self.player.x_scale = cmp(touch.location.x -
             self.player.position.x, 0)
                x = self.player.position.x
    

    Do I switch it to self.sprite.position

    Hmm

    posted in Pythonista read more
  • lance1994

    @ccc

    Beautiful ccc I think I love you 😂 But for real thank you, you been a big help in my journey.

    posted in Pythonista read more
  • lance1994

    @abcabc

    I dont understand how ai would implement this into my game , but the concept is what I'm looking for being able to see my players/enemy hit box. but I want to implement this with out going thru ui , there has to be a easier way. 🤔 I'm currently trying many different options

    posted in Pythonista read more
  • lance1994

    Chris Wilson Sure bro , I appreciate it.

    posted in Pythonista read more
  • lance1994

    Is there a way I can make the Rect around my player a color for debugging purposes I'm fairly new , and I'm sure this is fairly simple but I tried fill_color, set_color nothing worked. Here is the code

    player_hitbox = Rect(self.player.position.x - 20, 32, 40, 65,fill_color = "Blur")

    posted in Pythonista read more
  • lance1994

    Perfect fit Omz thanks bro.

    posted in Pythonista read more
  • lance1994

    So here's the basic code for flipping it with gravity and abs :

    def cmp (a, b):
    return ((a> _b) - (a < b))

    g = gravity()
    if abs(g.x) > 0.05:

            self.player.x_scale = cmp(g.x, 0)
    

    This basically flips the image horizontally by tilting your device , but how do I go about getting it to flip with touch location. I've tried many variations , one variation I tried only got him to turn on the negative - axis but not the positive. any suggestions? Here is my player movement code btw:

    x, _= touch.location
    , y = self.player.position
    move_action = Action.move_to(x,y,0.7,TIMING_SINODIAL)
    self.player.run_action(move_action)
    if (x,
    > 0.05):
    self.player.x_scale = cmp(-x, 0)
    x = self.player.position.x

    posted in Pythonista read more

Internal error.

Oops! Looks like something went wrong!