Ejemplo n.º 1
0
def bltStripe(x, y, img, u, v, w, h, col, p):
    for yy in range(p, h, 2):
        pyxel.blt(x, y + yy, img, u, v + yy, w, 1, col)
Ejemplo n.º 2
0
def draw():
    pyxel.cls(10)
    pyxel.line(x, y, pyxel.mouse_x, pyxel.mouse_y, pyxel.COLOR_WHITE)
    pyxel.blt(x - r, y - r, 0, 4, 3, 11, 11, pyxel.COLOR_BLACK)
Ejemplo n.º 3
0
    def draw(self):
        pyxel.cls(12)

        # draw sky
        pyxel.blt(0, 88, 0, 0, 88, 160, 32)

        # draw mountain
        pyxel.blt(0, 88, 0, 0, 64, 160, 24, 12)

        # draw forest
        offset = pyxel.frame_count % 160
        for i in range(2):
            pyxel.blt(i * 160 - offset, 104, 0, 0, 48, 160, 16, 12)

        # draw clouds
        offset = (pyxel.frame_count // 16) % 160
        for i in range(2):
            for x, y in self.far_cloud:
                pyxel.blt(x + i * 160 - offset, y, 0, 64, 32, 32, 8, 12)

        offset = (pyxel.frame_count // 8) % 160
        for i in range(2):
            for x, y in self.near_cloud:
                pyxel.blt(x + i * 160 - offset, y, 0, 0, 32, 56, 8, 12)

        # draw floors
        for x, y, is_active in self.floor:
            pyxel.blt(x, y, 0, 0, 16, 40, 8, 12)

        # draw fruits
        for x, y, kind, is_active in self.fruit:
            if is_active:
                pyxel.blt(x, y, 0, 32 + kind * 16, 0, 16, 16, 12)

        # draw player
        pyxel.blt(self.player_x, self.player_y, 0,
                  16 if self.player_vy > 0 else 0, 0, 16, 16, 12)

        # draw score
        s = 'SCORE {:>4}'.format(self.score)
        pyxel.text(5, 4, s, 1)
        pyxel.text(4, 4, s, 7)
Ejemplo n.º 4
0
def drawHiyoko(x, y):
    pyxel.blt(x, y, 0,
                16, 16, 16, 16, pyxel.COLOR_LIGHTGRAY)
Ejemplo n.º 5
0
def drawBackGround():
    pyxel.blt(0, 0, 1, 0, 0, 250, 150)
Ejemplo n.º 6
0
 def Draw(self):
     pyxel.blt(self.position["x"], self.position["y"], 0,
               self.__col_pos["x"], self.__col_pos["y"], 8, 8, 15)
Ejemplo n.º 7
0
def drawOrange(x, y):
    pyxel.blt(x, y, 0,
                16, 0, 16, 16, pyxel.COLOR_LIGHTGRAY)
Ejemplo n.º 8
0
 def drawUpperBar(self, legX, backSide):
     pyxel.blt(self.x + legX - 16, self.y - 8, 2, 0,
               152 if backSide else 144, 112, 8, 3)
Ejemplo n.º 9
0
 def render(self):
     pyxel.blt(self.anchor.x - 1, self.anchor.y - 5, 0, frame_x, 16,
               -self.direction * self.width + (3 * -self.direction),
               self.height + 5, 1)
Ejemplo n.º 10
0
 def draw(self):
     pyxel.cls(0)
     pyxel.text(55, 41, "test lol", 15)
     pyxel.blt(61, 66, 0, 0, 0, 38, 16)
Ejemplo n.º 11
0
 def draw(self):
     n = 0
     if abs(self.mover.dx) > 0.1:
         n = 1 + (self.cnt >> 2) & 3
     pyxel.blt(self.x, self.y, 1, 56 + n * 16, 208, 16 * self.fdx,
               16 * self.position, 0)
Ejemplo n.º 12
0
    def draw(self):
        pyxel.cls(0)

        #pyxel.text(55, 41, "Hello, Pyxel!", pyxel.frame_count % 16)
        #pyxel.blt(61, 66, 0, 0, 0, 38, 16)
        if self.stage == 1:
            pyxel.bltm(0, -8 + gcommon.map_y % 8, 0, self.mapOffsetX,
                       (256 - 33) - (int)(gcommon.map_y / 8), 32, 33)
        elif self.stage == 2:
            if gcommon.draw_star:
                for i in range(0, 128):
                    pyxel.pset(self.star_ary[i][0],
                               (self.star_pos + i * 2) % 255,
                               self.star_ary[i][1])

            #for obj in gcommon.ObjMgr.objs:
            #	if obj.layer==gcommon.C_LAYER_UNDER_GRD:
            #		if obj.hitcolor1 !=0 and obj.hit:
            #			pyxel.pal(obj.hitcolor1, obj.hitcolor2)
            #		obj.draw()
            #		if obj.hitcolor1 !=0 and obj.hit:
            #			pyxel.pal(obj.hitcolor1, obj.hitcolor1)
            # map
            pyxel.bltm(0, -8 + int(gcommon.map_y) % 8, 0, self.mapOffsetX,
                       (256 - 33) - (int)(gcommon.map_y / 8), 32, 33,
                       gcommon.TP_COLOR)
        elif self.stage == 3:
            if gcommon.draw_star:
                for i in range(0, 128):
                    pyxel.pset(self.star_ary[i][0],
                               (self.star_pos + i * 2) % 255,
                               self.star_ary[i][1])

            for obj in gcommon.ObjMgr.objs:
                if obj.layer == gcommon.C_LAYER_UNDER_GRD:
                    if obj.hitcolor1 != 0 and obj.hit:
                        pyxel.pal(obj.hitcolor1, obj.hitcolor2)
                    obj.draw()
                    if obj.hitcolor1 != 0 and obj.hit:
                        pyxel.pal(obj.hitcolor1, obj.hitcolor1)
            # map
            if gcommon.map_y < 1664:
                pyxel.bltm(0, -8 + int(gcommon.map_y) % 8, 0, self.mapOffsetX,
                           (256 - 33) - (int)(gcommon.map_y / 8), 32, 33,
                           gcommon.TP_COLOR)

        # enemy(ground)
        for obj in gcommon.ObjMgr.objs:
            if obj.layer == gcommon.C_LAYER_GRD or obj.layer == gcommon.C_LAYER_HIDE_GRD:
                if obj.hitcolor1 != 0 and obj.hit:
                    pyxel.pal(obj.hitcolor1, obj.hitcolor2)

                obj.draw()
                if obj.hitcolor1 != 0 and obj.hit:
                    pyxel.pal(obj.hitcolor1, obj.hitcolor1)

        # explosion(ground)
        for obj in gcommon.ObjMgr.objs:
            if obj.layer == gcommon.C_LAYER_EXP_GRD:
                obj.draw()

        # upper ground
        for obj in gcommon.ObjMgr.objs:
            if obj.layer == gcommon.C_LAYER_UPPER_GRD:
                obj.draw()

        # item
        for obj in gcommon.ObjMgr.objs:
            if obj.layer == gcommon.C_LAYER_ITEM:
                obj.draw()

        # my bom
        if gcommon.ObjMgr.myBom != None:
            gcommon.ObjMgr.myBom.draw()

        # enemy(sky)
        for obj in gcommon.ObjMgr.objs:
            if obj.layer == gcommon.C_LAYER_SKY:
                if obj.hitcolor1 != 0 and obj.hit:
                    pyxel.pal(obj.hitcolor1, obj.hitcolor2)

                obj.draw()
                if obj.hitcolor1 != 0 and obj.hit:
                    pyxel.pal(obj.hitcolor1, obj.hitcolor1)

        # enemy shot and explosion(sky)
        for obj in gcommon.ObjMgr.objs:
            if obj.layer == gcommon.C_LAYER_EXP_SKY or obj.layer == gcommon.C_LAYER_E_SHOT:
                obj.draw()

        # my shot
        for shot in gcommon.ObjMgr.shots:
            shot.draw()

        # my ship
        gcommon.ObjMgr.myShip.draw()

        for obj in gcommon.ObjMgr.objs:
            if obj.layer == gcommon.C_LAYER_TEXT:
                obj.draw()

        # SCORE表示
        pyxel.text(4, 2, "SCORE " + str(gcommon.score), 7)

        # 残機
        pyxel.blt(232, 2, 0, 48, 32, 6, 8, gcommon.C_COLOR_KEY)
        pyxel.text(242, 4, str(gcommon.remain), 7)

        # BOM
        for i in range(0, gcommon.bomRemain):
            pyxel.blt(4 + i * 6, 244, 0, 56, 32, 6, 8, gcommon.C_COLOR_KEY)

        #pyxel.text(0, 220, str(gcommon.game_timer), 7)
        # マップ位置表示
        #pyxel.text(0, 230, str(gcommon.map_y), 7)

        if self.pause:
            pyxel.rect(127 - 24, 127 - 10, 48, 20, 0)
            pyxel.rectb(127 - 24, 127 - 10, 48, 20, 7)
            gcommon.TextHCenter(127 - 3, "PAUSE", 7, -1)
Ejemplo n.º 13
0
def desenhar_flappy():
    frame = (pyxel.frame_count // 4) % 3
    pyxel.blt(_.flappy_x, _.flappy_y, 0, 0, frame * 16, 17, 13, 0)
Ejemplo n.º 14
0
def desenhar_canos():
    for (x, y) in _.canos:
        pyxel.blt(x, y, 1, 0, 0, 25, 150, 0)
        pyxel.blt(x, y + _.abertura_cano, 1, 0, 0, 25, -150, 0)
Ejemplo n.º 15
0
 def draw(self):
     pyxel.blt(self.x, self.y, 0, self.icon_x ,0, 16, 16, 0)
     self.update_icon()
Ejemplo n.º 16
0
def handleHearts(life):
    if life > 1:
        if life < 3:
            pyxel.blt(x=2, y=3, img=1, u=0, v=0, w=7, h=6, colkey=0)

            pyxel.blt(x=9, y=3, img=1, u=0, v=0, w=7, h=6, colkey=0)

            pyxel.blt(x=16, y=3, img=1, u=14, v=0, w=7, h=6, colkey=0)

        else:
            pyxel.blt(x=2, y=3, img=1, u=0, v=0, w=7, h=6, colkey=0)

            pyxel.blt(x=9, y=3, img=1, u=0, v=0, w=7, h=6, colkey=0)

            pyxel.blt(x=16, y=3, img=1, u=0, v=0, w=7, h=6, colkey=0)

    else:
        pyxel.blt(x=2, y=3, img=1, u=0, v=0, w=7, h=6, colkey=0)

        pyxel.blt(x=9, y=3, img=1, u=14, v=0, w=7, h=6, colkey=0)

        pyxel.blt(x=16, y=3, img=1, u=14, v=0, w=7, h=6, colkey=0)
Ejemplo n.º 17
0
    def draw(self):
        x = self.PosX + self.PosAdjX
        y = self.PosY + self.PosAdjY

        if self.PlDir == 0:
            pyxel.blt(x, y, 0, 16, 0, 16, 16, 0)  # 前

            if pyxel.frame_count & 0x04:
                pyxel.blt(self.PosX + 0, self.PosY + 8, 0, 8, 16, 6, 6, 0)
                pyxel.blt(self.PosX - 6, self.PosY + 8, 0, 8, 16, -6, 6, 0)
            else:
                pyxel.blt(self.PosX + 0, self.PosY + 8, 0, 8, 24, 6, 6, 0)
                pyxel.blt(self.PosX - 6, self.PosY + 8, 0, 8, 24, -6, 6, 0)
        else:
            if self.PlDir == 1:
                pyxel.blt(x, y, 0, 0, 0, 16, 16, 0)  # 左
            else:
                pyxel.blt(x, y, 0, 32, 0, 16, 16, 0)  # 右

            if pyxel.frame_count & 0x04:
                pyxel.blt(self.PosX - 1, self.PosY + 8, 0, 8, 16, 6, 6, 0)
                pyxel.blt(self.PosX - 5, self.PosY + 8, 0, 8, 16, -6, 6, 0)
            else:
                pyxel.blt(self.PosX - 1, self.PosY + 8, 0, 8, 24, 6, 6, 0)
                pyxel.blt(self.PosX - 5, self.PosY + 8, 0, 8, 24, -6, 6, 0)

        # 中心の表示
        shooting_sub.DebugDrawPosHitRect(self)
Ejemplo n.º 18
0
def handleKeys(key, pos):
    if key:
        pyxel.blt(x=pos[0], y=pos[1], img=1, u=26, v=0, w=5, h=6, colkey=0)
    else:
        pyxel.blt(x=pos[0], y=pos[1], img=1, u=21, v=0, w=5, h=6, colkey=0)
Ejemplo n.º 19
0
def drawRingo(x, y):
    pyxel.blt(x, y, 0,
              0, 0, 16, 16, pyxel.COLOR_LIGHTGRAY)
Ejemplo n.º 20
0
 def draw(self):
     pyxel.blt(self.x, self.y, 0, TORTURED_SOUL[0], TORTURED_SOUL[1], 16,
               16, 0)
     self.update()
Ejemplo n.º 21
0
def drawBucket(x, y):
    pyxel.blt(x, y, 0,
                0, 16, 16, 16, pyxel.COLOR_LIGHTGRAY)
Ejemplo n.º 22
0
 def update(self):
     Scuttling_Thing.update(self)
     pyxel.blt(self.x, self.y, 0, TORTURED_SOUL[0], TORTURED_SOUL[1], 16,
               16, 0)
Ejemplo n.º 23
0
def drawUribo(x, y):
    pyxel.blt(x, y, 0,
                32, 16, 16, 16, pyxel.COLOR_LIGHTGRAY)
Ejemplo n.º 24
0
 def draw(self):
     pyxel.blt(self.x, self.y, 0, LIFE[0], LIFE[1], 16, 16, 0)
     self.update()
Ejemplo n.º 25
0
 def draw(self):
     pyxel.cls(0)
     # 猫を表示
     pyxel.blt(16, 16, 0, 0, 0, 16, 16, 11)
     #テキスト表示
     pyxel.text(120/2 -15, 120/2 - 10, 'Hello Pyxel', pyxel.frame_count % 16)
Ejemplo n.º 26
0
 def update(self):
     Scuttling_Thing.update(self)
     pyxel.blt(self.x, self.y, 0, LIFE[0], LIFE[1], 16, 16, 0)
Ejemplo n.º 27
0
 def draw(self):
     pyxel.blt(self.x, self.y, 0, 0, 0, 16, 16)
Ejemplo n.º 28
0
 def draw(self):
     pyxel.blt(self.x, self.y, 0, REDBULL[0], REDBULL[1], 16, 16, 0)
 def render(self):
     pyxel.rect(0, 0, pyxel.width, pyxel.height, pyxel.COLOR_BLACK)
     pyxel.blt(self.h_center, 10, _TILE_SCR_, 0, 0, *self.tile_resolution)
     pyxel.text(80, 220, "GOOD END", pyxel.COLOR_WHITE)
Ejemplo n.º 30
0
def sspr1(sx, sy, sw, sh, dx, dy):
    pyxel.blt(dx, dy, 1, sx * 2, sy * 2, sw * 2, sh * 2, TP_COLOR)