Skip to content

Instantly share code, notes, and snippets.

View bitcoin4cashqc's full-sized avatar

bitcoin4cashqc

View GitHub Profile
@bitcoin4cashqc
bitcoin4cashqc / gist:8f7e15d4ee70ab172b194306191920cc
Last active February 20, 2019 01:03
Help for collision check with Pyxel
collide = 4 # between [0 - Player_img_size]
def collideWithPlayer(Player,enemy):
"""return: (bool) collide with Player or not """
p_pos = Player.getPos() # where the position is x y
playr_x, playr_y = p_pos.x, p_pos.y
playr_w, playr_h = Player.getSize() #where the size is w h
for pos in self.pos: