Ejemplo n.º 1
0
 def draw(self):
     pyxel.cls(0)
     if self.FLAG == 0:
         pyxel.text(64, 45, "N E O N", pyxel.frame_count % 16)
         self.title_circ(63, 64)
         if (pyxel.frame_count % 60 < 30):
             pyxel.text(34, 80, "press spacebar to start", 5)
     elif self.FLAG == 1:
         self.TIME -= 1
         pyxel.circ(self.x, self.y, self.r, self.color)
         pyxel.circb(self.x, self.y, self.r2, self.color)
         pyxel.text(10, 10, "score " + str(self.SCORE), 7)
         pyxel.text(10, 20, "life  " + str(self.LIFE), 7)
         pyxel.text(10, 30, "level  " + str(self.LEVEL), 7)
         pyxel.text(10, 40, "time  " + str(self.TIME), 7)
         pyxel.text(110, 10, "best  " + str(self.BESTSCORE), 7)
         if self.r < self.r2: self.r += 1
         else: self.reset()
     elif self.FLAG == 2:
         pyxel.text(64, 45, "GAME OVER", pyxel.frame_count % 16)
         pyxel.text(61, 55, "score : " + str(self.SCORE), 7)
         if (pyxel.frame_count % 60 < 30):
             if self.SCORE == self.BESTSCORE:
                 pyxel.text(61, 65, "BEST SCORE!", 7)
             pyxel.text(30, 90, "press spacebar to restart", 5)
     else:
         pyxel.text(64, 45, "LEVEL UP!", pyxel.frame_count % 16)
         if (pyxel.frame_count % 60 < 30):
             pyxel.text(30, 80, "press spacebar to continue", 5)
Ejemplo n.º 2
0
def draw_circle1():

    # generator
    if (pyxel.frame_count % 30 == 0):
        for index in range(len(start_chk)):
            if (start_chk[index][0] == 0):
                start_chk[index][0] = 1
                start_chk[index][1] = random.randint(0, SCREEN_WIDTH)
                start_chk[index][2] = random.randint(0, SCREEN_HEIGHT)
                start_chk[index][3] = pyxel.frame_count % 16
                break

    # gupdate circle
    if (pyxel.frame_count % 3 == 0):
        for circle in start_chk:
            if (circle[0] > 0):
                circle[0] += 1

            if (circle[0] > SCREEN_WIDTH / 2):
                circle[0] = 0

    # draw circle
    for circle in start_chk:
        if (circle[0] > 0):
            pyxel.circb(circle[1], circle[2], circle[0], circle[3])
            if (circle[3] % 3 == 0):
                pyxel.circb(circle[1], circle[2], circle[0] + 2, circle[3])
Ejemplo n.º 3
0
    def draw(self):
        x, y = self.xy
        if pyxel.frame_count % self.twinkle_interval == 0:
            pyxel.circb(x, y, 1, self.color)
#            pyxel.blt(self.sprite)
        else:
            pyxel.pix(*self.xy, self.color)
Ejemplo n.º 4
0
 def draw_points(self):
     for point in self.points:
         pyxel.circ(point.x, point.y, 2, 2)
         pyxel.circb(point.x, point.y, 10, point.color)
         pyxel.tri(point.x, point.y+5, point.x-10, point.y-10, point.x+10, point.y-10, point.color)
         pyxel.tri(point.x-10, point.y, point.x+10, point.y, point.x, point.y-15, point.color) #空
         #pyxel.text(point.x, point.y, f'Now is {self.color} color', self.color)# change
         pyxel.text(point.x, point.y, f'Now is {self.stack.size()} Number', self.color)## show the number of stack
Ejemplo n.º 5
0
 def part(ox, oy, r, r2):
     pyxel.circ(ox, oy, r, 7)
     pyxel.circb(ox, oy, r, 0)
     dx, dy, r = pyxel.mouse_x - ox, pyxel.mouse_y - oy, r - r2
     l = (dx * dx + dy * dy)**0.5  # math.sqrt
     pyxel.circ(
         *((pyxel.mouse_x, pyxel.mouse_y) if l < r else
           (ox + dx * r // l, oy + dy * r // l)), r2, 0)
Ejemplo n.º 6
0
 def draw_points(self):
     for point in self.points:
         pyxel.circ(point.x, point.y, 2, 2)
         pyxel.circb(point.x, point.y, 10, point.color)
         pyxel.tri(point.x, point.y + 5, point.x - 10, point.y - 10,
                   point.x + 10, point.y - 10, point.color)
         pyxel.tri(point.x - 10, point.y, point.x + 10, point.y, point.x,
                   point.y - 15, point.color)  #空
Ejemplo n.º 7
0
def campo(x):
    # desenho do campo
    pyxel.bltm(0, 0, x, 0, 0, 30, 30)
    pyxel.text(15, 17, "FutAvengers", 7)  #nome do jogo
    pyxel.text(80, 13, "P l a y e r  1", 3)  #placar - jogador 1
    pyxel.text(170, 13, "P l a y e r  2", 8)  #placar - jogador 2
    pyxel.circb(0, 120, 30, 7)  #círculo do lado esquerdo
    pyxel.circb(240, 120, 30, 7)  #círculo do lado esquerdo
Ejemplo n.º 8
0
    def test_circb(self, x, y):
        pyxel.text(x, y, "circb(x,y,r,col)", 7)

        x += 4
        y += 15

        for i in range(8):
            pyxel.circb(x + i * 8, y, i, i + 8)
Ejemplo n.º 9
0
 def debug_draw_circle(pos,
                       angle,
                       radius,
                       outline_color,
                       fill_color,
                       data=None):
     pyxel.circ(*pos, r=radius - 1, col=fill_color)
     pyxel.circb(*pos, r=radius, col=outline_color)
Ejemplo n.º 10
0
 def _draw_circ_and_name(self, sys_pos, circ_col, name_col):
     dx, dy = self._cam.d_pos
     star_system_name = self.stars_systems.get(sys_pos).name
     x = sys_pos[0] - int(dx)
     y = sys_pos[1] - int(dy)
     name_length = len(star_system_name)
     center_x = name_length * 4 // 2
     pyxel.circb(x, y, 3, circ_col)
     pyxel.text(x - center_x, y - 10, star_system_name, name_col)
Ejemplo n.º 11
0
    def draw(self):
        pyxel.cls(0)
        # 猫を表示
        pyxel.blt(self.cat.pos.x, self.cat.pos.y, self.cat.img_id, 0, 0, 16, 16, 13)
        #テキスト表示
        pyxel.text(120/2 -15, 120/2 - 10, 'Hello Pyxel', pyxel.frame_count % 16)

        #円表示
        if self.draw_flag == 1:
            pyxel.circb(self.cat.pos.x + 16/2, self.cat.pos.y + 16/2, 12, 8)
Ejemplo n.º 12
0
    def draw(self):
        pyxel.cls(1)
        if self.ponto_clique is not None:
            pyxel.line(self.ponto_clique[0], self.ponto_clique[1],
                       pyxel.mouse_x, pyxel.mouse_y, 7)
            pyxel.circ(pyxel.mouse_x, pyxel.mouse_y, 10, 10)
            pyxel.circb(pyxel.mouse_x, pyxel.mouse_y, 10, 9)

        for bola in self.bolas:
            pyxel.circ(bola.x, bola.y, bola.raio, 10)
            pyxel.circb(bola.x, bola.y, bola.raio, 9)
Ejemplo n.º 13
0
    def draw(self):
        if self.state == 0:
            pyxel.circb(self.x, self.y, self.cnt**1.2 * 2, 7)
            #--circfill(self.x+(self.r-self.l)/2,
            #-- self.y+(self.b-self.u)/2, self.cnt,7)
            gcommon.circfill_obj_center(self, self.cnt**1.2, 7)
            gcommon.draw_splash(self)

        elif self.state == 1:
            if self.cnt & 3 == 3:
                pyxel.rect(0, 0, 256, 256, 7)
Ejemplo n.º 14
0
    def draw(self):
        fc=pyxel.frame_count
        if self.pallet_test==1:pal(2,3)# pallet swap - test_pal1
        if self.pallet_test==2:pal(4,7)
        if self.pallet_test==3:pal(7,10)
        _,__=cls(2),text(6,6, "cls(col)",7) #self.test_cls(6, 6)
        
        text(6, 20, "pix(x,y,col)", 7)
        for i in range(16):pix(10 + i*2, 30, i)

        text(106, 6, "line(x1,y1,x2,y2,col)", 7)
        for i in range(3):line(110, 15 + i * 8, 158, 15 + i * 8, 5+i)
        for i in range(4):line(110 + i*16, 15,110 + i * 16,31, 8+i)
        for i in range(4):line(110 + i*16, 15,110+ (3 - i) * 16,31, 12+i)
        
        text(6, 38, "rect(x,y,w,h,col)", 7)
        for i in range(8):rect(10 + i * 8, 54 - i, i + 1, i + 1, i + 8)

        text(106, 38, "rectb(x,y,w,h,col)", 7)
        for i in range(8):rectb(110+i*8,54- i, i + 1, i + 1, i + 8)

        text(6,61, "circ(x,y,r,col)", 7)
        for i in range(8):circ(10+ i * 8,76, i, i + 8)
        
        text(106, 61, "circb(x,y,r,col)", 7)
        for i in range(8):circb(110+i*8,76,i,i+8)

        text(6,88, "blt(x,y,img,u,v,\n    w,h,[colkey])", 7)
        x,y=6,103
        blt(x, y, 0, 0, 0, 16, 16)
        blt(x + math.sin(fc * 0.1) * 2 + 19, y, 0, 0, 0, 16, 16, 5)
        blt(x + 38, y, 0, 0, 0, -16, 16, 5)
        blt(x + 57, y, 0, 0, 0, 16, -16, 5)
        blt(x + 76, y, 0, 0, 0, -16, -16, 5)

        text(106, 88, "bltm(x,y,tm,u,v,\n w,h,[colkey])", 7)
        bltm(106, 103, 0, 0, 0, 11, 2, 2)

        text(6, 124, "text(x,y,s,col)",7)
        s = "Elapsed frame count is {}\n" "Current mouse position is ({},{})".format(fc,pyxel.mouse_x,pyxel.mouse_y)
        text(11,133,s,1)# shadow
        text(10,132,s,9)

        _,__=text(106, 124, "pal(col1,col2)", 4),pal()# test_pal2 

        if not self.clip_test:return
        clip()
        x,y,w,h=math.sin(fc*0.02)*39+40,math.sin(fc*0.03)*29+30,120,90
        text(x,y-8,"clip(x,y,w,h)",14)
        rectb(x-1,y-1,w+2,h+2,14)
        clip(x,y,w,h)
Ejemplo n.º 15
0
    def draw(self):
        pyxel.cls(0)

        # 星
        for i in range(0, 96):
            pyxel.pset(EndingScene.star_ary[i][0], i * 2,
                       int(random.randrange(0, 2) + 5))

        if self.state == 0:
            if self.cnt & 2 == 0:
                pyxel.blt(104, 76, 2, 208, 0, 48, 48, 0)
            else:
                pyxel.blt(104, 76, 2, 208, 48, 48, 48, 0)

        elif self.state == 1:
            if self.radius < 150:
                pyxel.circb(128, 100, self.radius * self.radius / 10, 7)
                pyxel.circ(128, 100, self.radius, 6)
            elif self.radius < 200:
                pyxel.rect(0, 0, 256, 200, 12)
            elif self.radius < 250:
                pyxel.rect(0, 0, 256, 200, 5)
            elif self.radius < 300:
                pyxel.rect(0, 0, 256, 200, 1)

        if self.state == 2:
            if self.cnt % 3 == 0:
                sx = self.sptable[self.cnt % 4]
                pyxel.blt(self.px - 15, self.py - 15, 2, 32 * sx, 0, 32, 32, 0)

        newTbl = []
        for s in self.tbl:
            s.cnt -= 1
            if s.cnt != 0:
                skip = False
                n = (s.life - s.cnt) / s.life
                if n > 0.5:
                    if s.cnt & 1 == 0:
                        skip = True
                elif n > 0.6:
                    if s.cnt & 3 != 0:
                        skip = True
                elif n > 0.8:
                    if s.cnt & 7 != 0:
                        skip = True
                if skip == False:
                    pyxel.pset(s.x, s.y, 7)
                newTbl.append(s)
        self.tbl = newTbl
Ejemplo n.º 16
0
	def render(self):
		global right_dragging, right_drag_x, right_drag_y
		if right_dragging:
			self.radius = sqrt((px.mouse_x-right_drag_x)**2+(px.mouse_y-right_drag_y)**2)
			px.circ(right_drag_x, right_drag_y, self.radius, self.color)
		elif left_dragging:
			px.circ(left_drag_x, left_drag_y, self.radius, self.color)
			_objs = np.array([Mass(obj.x, obj.y, obj.x_vec, obj.y_vec, obj.mass, "circle", 1) for obj in objs]+[Mass(
				x=left_drag_x+camera_x,
				y=left_drag_y+camera_y,
				x_vec=(px.mouse_x-left_drag_x)/25,
				y_vec=(px.mouse_y-left_drag_y)/25,
				mass=rtom(self.radius),
				color=8)])
			for tick in range(500):
				for self_obj in _objs:
					for other_obj in _objs:
						if other_obj == self_obj:
							continue
						try:
							self_obj.x_vec += -(4*other_obj.mass*(self_obj.x-other_obj.x))/(((self_obj.x-other_obj.x)**2+(self_obj.y-other_obj.y)**2)**(3/2))
						except ZeroDivisionError: pass
						try:
							self_obj.y_vec += -(4*other_obj.mass*(self_obj.y-other_obj.y))/(((self_obj.x-other_obj.x)**2+(self_obj.y-other_obj.y)**2)**(3/2))
						except ZeroDivisionError: pass

				for obj in _objs:
					obj.x += obj.x_vec
					obj.y += obj.y_vec

				for self_obj in _objs:
					for other_obj in _objs:
						if other_obj == self_obj:
							continue
						if sqrt((self_obj.x-other_obj.x)**2+(self_obj.y-other_obj.y)**2) < mtor(self_obj.mass)+mtor(other_obj.mass):
							#px.circb(self_obj.x-camera_x, self_obj.y-camera_y, mtor(self_obj.mass), self_obj.color)
							#px.circb(other_obj.x-camera_x, other_obj.y-camera_y, mtor(other_obj.mass), other_obj.color)
							other_obj.x_vec = other_obj.mass/(other_obj.mass+self_obj.mass) * other_obj.x_vec + self_obj.mass/(other_obj.mass+self_obj.mass) * self_obj.x_vec	
							other_obj.y_vec = other_obj.mass/(other_obj.mass+self_obj.mass) * other_obj.y_vec + self_obj.mass/(other_obj.mass+self_obj.mass) * self_obj.y_vec	
							other_obj.x = other_obj.mass/(other_obj.mass+self_obj.mass) * other_obj.x + self_obj.mass/(other_obj.mass+self_obj.mass) * self_obj.x	
							other_obj.y = other_obj.mass/(other_obj.mass+self_obj.mass) * other_obj.y + self_obj.mass/(other_obj.mass+self_obj.mass) * self_obj.y	
							other_obj.mass += self_obj.mass
							px.circb(other_obj.x-camera_x, other_obj.y-camera_y, mtor(other_obj.mass), other_obj.color)
							_objs = np.delete(_objs, np.where(_objs == self_obj), 0)
				for obj in _objs:
					px.pix(obj.x-camera_x, obj.y-camera_y, obj.color)
		else:
			px.circb(px.mouse_x, px.mouse_y, self.radius, self.color)
Ejemplo n.º 17
0
    def draw(self, car):
        VEL_POS = (40, 200)
        GAS_POS = (90, 200)

        pyxel.circ(GAS_POS[0], GAS_POS[1], 15, 0)
        pyxel.circb(GAS_POS[0], GAS_POS[1], 16, 7)

        angle_gas = -math.pi * 7 / 8 + (6 / 320 * math.pi * car.fuel)
        pyxel.line(GAS_POS[0], GAS_POS[1],
                   GAS_POS[0] + 8 * math.cos(angle_gas),
                   GAS_POS[1] + 8 * math.sin(angle_gas), 9)
        pyxel.text(GAS_POS[0] + 10, GAS_POS[1] - 7, "F", 7)
        pyxel.text(GAS_POS[0] - 12, GAS_POS[1] - 7, "E", 7)

        if car.fuel <= 5 and car.fuel > 0:
            if int(pyxel.frame_count / 10) % 8 < 4:
                Sprite(1, (0, 0), (15, 15), 0).draw(GAS_POS[0] - 8,
                                                    GAS_POS[1] - 17)
        elif car.fuel == 0:
            Sprite(1, (0, 0), (15, 15), 0).draw(GAS_POS[0] - 8,
                                                GAS_POS[1] - 17)

        pyxel.circ(VEL_POS[0], VEL_POS[1], 30, 0)
        pyxel.circb(VEL_POS[0], VEL_POS[1], 31, 7)
        pyxel.text(VEL_POS[0] - 28, VEL_POS[1] - 6, "0", 7)
        pyxel.text(VEL_POS[0] - 25, VEL_POS[1] - 15, "30", 7)
        pyxel.text(VEL_POS[0] - 15, VEL_POS[1] - 25, "70", 7)
        pyxel.text(VEL_POS[0] - 2, VEL_POS[1] - 28, "130", 7)
        pyxel.text(VEL_POS[0] + 10, VEL_POS[1] - 22, "150", 7)
        pyxel.text(VEL_POS[0] + 10, VEL_POS[1] - 22, "180", 7)
        pyxel.text(VEL_POS[0] + 15, VEL_POS[1] - 10, "210", 7)
        if (car.vel >= 0) or (abs(car.vel) < 1):
            pyxel.line(
                VEL_POS[0], VEL_POS[1], VEL_POS[0] +
                20 * math.cos(math.pi + 0.1 + (math.pi / 250 * car.vel)),
                VEL_POS[1] + 25 * math.sin(math.pi + 0.1 +
                                           (math.pi / 250 * car.vel)), 8)
        else:
            pyxel.line(
                VEL_POS[0], VEL_POS[1], VEL_POS[0] +
                20 * math.cos(math.pi + 0.1 + abs(math.pi / 200 * car.vel)),
                VEL_POS[1] +
                25 * math.sin(math.pi + 0.1 + abs(math.pi / 200 * car.vel)), 8)
            pyxel.text(VEL_POS[0] + 5, VEL_POS[1] - 10, "R", 8)
Ejemplo n.º 18
0
	def draw(self):
		if self.state< 100:
			#spr(192,self.x,self.y,5,4)
			#spr(197+self.sd*2,self.x+10,self.y+4,2,2)
			pyxel.blt(self.x, int(self.y), 1, 0, 192, 80, 64, gcommon.TP_COLOR)
			pyxel.blt(self.x +20, int(self.y) +8, 1, 80 + self.sd*32, 192, 32, 32, gcommon.TP_COLOR)
		elif self.state < 103:
			#spr(192,self.x,self.y,5,4)
			pyxel.blt(self.x, int(self.y), 1, 0, 192, 80, 64, gcommon.TP_COLOR)
		else:
			#spr(203,self.x+10,self.y+10,2,2)
			pyxel.blt(self.x+20, int(self.y)+20, 1, 176, 192, 32, 32, gcommon.TP_COLOR)
		
		if self.state==102:
			pyxel.circb(self.x+(self.right-self.left)/2,
				self.y+(self.bottom-self.top)/2, self.cnt*2*2,7)
			gcommon.circfill_obj_center(self, self.cnt*2, 7)
			r = 0
			for i in range(1,201):
				rr = math.sqrt((self.cnt*2+i)*20)*2
				pyxel.pset(			\
					self.x+(self.right-self.left+1)/2+math.cos(r) * rr,		\
					self.y+(self.bottom-self.top+1)/2+math.sin(r) * rr,		\
					7 + int(self.cnt%2)*3)
				# kore ha tekito
				r += 0.11 + i*0.04
			
		elif self.state==103:
			d=True
			r=20
			clr=7
			if self.cnt<60:
				d = (self.cnt & 1)==1
			elif self.cnt<120:
				d = (self.cnt & 3)==3
				r = 16
				clr = 10
			else:
				d = (self.cnt & 7)==7
				r = 12
				clr = 9
			
			if d:
				gcommon.circfill_obj_center(self, r, clr)
Ejemplo n.º 19
0
    def draw(self):
        # 画面のクリア
        pyxel.cls(1)

        # 描画テスト
        for i in range(10):
            # 矩形
            pyxel.rectb(
                random.randrange(0, pyxel.width),
                random.randrange(0, pyxel.height),
                random.randrange(0, pyxel.width),
                random.randrange(0, pyxel.height),
                random.randrange(0, 16))

            # 線
            pyxel.line(
                random.randrange(0, pyxel.width),
                random.randrange(0, pyxel.height),
                random.randrange(0, pyxel.width),
                random.randrange(0, pyxel.height),
                random.randrange(0, 16))

            # 点
            pyxel.pix(
                random.randrange(0, pyxel.width),
                random.randrange(0, pyxel.height),
                random.randrange(0, 16))

            # 円
            pyxel.circb(
                random.randrange(0, pyxel.width),
                random.randrange(0, pyxel.height),
                random.randrange(0, 16),
                random.randrange(0, 16))

            # パレットの入れ替え
            pyxel.pal(random.randrange(0, 16), random.randrange(0, 16))

        # 画像の描画
        pyxel.blt((pyxel.width - self.cat['width']) / 2, (pyxel.height - self.cat['height']) / 2, 0, 0, 0, self.cat['width'], self.cat['height'])

        # パレットを戻す
        pyxel.pal()
Ejemplo n.º 20
0
    def draw(self):
        pyxel.cls(0)
        if self.game_over_flag != GAME_OVER:
            #スコア表示
            pyxel.text(5, 5, "score:" + str(self.score.point), 7)

            #ネコ表示
            pyxel.blt(self.cat.pos.x, self.cat.pos.y, self.cat.img_id, 0, 0,
                      CAT_W, CAT_H, self.cat.img_a)

            #ネズミ表示
            mouse_count = len(self.mouses)
            for i in range(mouse_count):
                pyxel.blt(self.mouses[i].pos.x, self.mouses[i].pos.y,
                          self.mouses[i].img_id, 0, 0, ENEMY_W, ENEMY_H,
                          self.mouses[i].img_a)

            #マル表示
            if self.cat.draw_flag == 1:
                pyxel.circb(self.cat.pos.x + CAT_W / 2,
                            self.cat.pos.y + CAT_H / 2, CIRC_SIZE, 8)
                self.maru_flag = 1

            #バツ表示
            for i in range(len(self.mouses)):
                if self.mouses[i].draw_flag == 2:
                    x = self.mouses[i].pos.x
                    y = self.mouses[i].pos.y
                    pyxel.line(x - 2, y - 2, x + CAT_W + 2, y + CAT_H + 2, 5)
                    pyxel.line(x + CAT_W + 2, y - 2, x - 2, y + CAT_H + 2, 5)
                    self.batu_count += 1

        #ゲームオーバーになったら
        else:
            pyxel.cls(0)
            pyxel.text(WINDOW_W / 2 - 15, WINDOW_H / 2 - 10, "Game Over",
                       pyxel.frame_count % 16)
            pyxel.text(WINDOW_W / 2 - 10, WINDOW_H / 2,
                       "score:" + str(self.score.point),
                       pyxel.frame_count % 16)
            pyxel.text(WINDOW_W / 2 - 60, WINDOW_H / 2 + 20,
                       "restart:push mouse left button",
                       pyxel.frame_count % 16)
Ejemplo n.º 21
0
def campo():
    pyxel.rect(5, 45, 235, 195, 12)  #cor do campo
    pyxel.rect(0, 40, 5, 200, 7)  #lateral do lado esquerdo
    pyxel.rect(5, 40, 240, 45, 7)  #lateral de cima
    pyxel.rect(235, 45, 240, 200, 7)  #lateral do lado direito
    pyxel.rect(5, 195, 235, 200, 7)  #lateral de baixo
    pyxel.rect(118, 45, 122, 195, 7)  #linha do centro
    pyxel.rect(0, 90, 5, 150, 9)  #gol esquerdo
    pyxel.rect(235, 90, 240, 150, 9)  #gol direito
    pyxel.rect(0, 0, 240, 40, 1)  #tela de placar
    pyxel.rect(0, 0, 5, 40, 6)  #tela de placar - borda esquerda
    pyxel.rect(235, 0, 240, 40, 6)  #tela de placar - borda direita
    pyxel.rect(5, 35, 235, 40, 6)  #tela de placar - borda esquerda
    pyxel.rect(5, 0, 235, 5, 6)  #tela de placar - borda esquerda
    pyxel.text(15, 17, "FutAvengers", 7)  #nome do jogo
    pyxel.text(80, 13, "P l a y e r  1", 3)  #placar - jogador 1
    pyxel.text(170, 13, "P l a y e r  2", 8)  #placar - jogador 2
    pyxel.circb(0, 120, 30, 7)  #círculo do lado esquerdo
    pyxel.circb(240, 120, 30, 7)  #círculo do lado esquerdo
Ejemplo n.º 22
0
    def draw(self):
        pyxel.cls(0)

        if self.setomaru.is_dead:
            pyxel.text(100, 128, "GAME OVER", 7)
            pyxel.text(120, 158, "puress R key", 3)
            return

        for shark in self.sharks:
            if shark.is_dead:
                pyxel.text(shark.pos.x + 20, shark.pos.y + 25, "+1", 11)
            else:
                pyxel.blt(shark.pos.x, shark.pos.y, 1, 0, 0, 50, 50, 0)

        pyxel.blt(self.setomaru.pos.x, self.setomaru.pos.y, 0, 0, 0, 50, 50, 0)

        pyxel.circb(pyxel.mouse_x, pyxel.mouse_y, 10, 8)

        if pyxel.frame_count % 50 < 10:
            pyxel.text(100, 128, "BIWA SHARK", pyxel.frame_count % 15 + 1)
        pyxel.text(100, 140, "score :" + str(self.score), 12)
Ejemplo n.º 23
0
	def draw(self):
		if self.size==1:
			pyxel.circb(self.x, self.y, self.cnt*2+1, 10)
		elif self.size==2:
			if self.cnt<8:
				pyxel.circ(self.x, self.y, self.cnt*2+1, 10)
			elif self.cnt < 25:
				if self.cnt%2 ==0:
					pyxel.blt( self.x-24, self.y-24, 0, 208, 208,
						24*2 -(self.cnt &2) * 48,
						24*2 -(self.cnt &4) * 24,
						gcommon.C_COLOR_KEY)
			else:
				if self.cnt%2 ==0:
					pyxel.pal(7, gcommon.TP_COLOR)
					pyxel.blt( self.x-24, self.y-24, 0, 208, 208,
						24*2 -(self.cnt &2) * 48,
						24*2 -(self.cnt &4) * 24,
						gcommon.C_COLOR_KEY)
					pyxel.pal()
		else:
			if self.cnt<8:
				pyxel.circ(self.x, self.y, self.cnt*2+1, 10)
			elif self.cnt < 25:
				if self.cnt%2 ==0:
					pyxel.blt( self.x-36, self.y-36, 0, 184, 88,
						72 -(self.cnt &2) * 72,
						72 -(self.cnt &4) * 36,
						gcommon.C_COLOR_KEY)
			else:
				if self.cnt%2 ==0:
					pyxel.pal(7, gcommon.TP_COLOR)
					pyxel.blt( self.x-36, self.y-36, 0, 184, 88,
						72 -(self.cnt &2) * 72,
						72 -(self.cnt &4) * 36,
						gcommon.C_COLOR_KEY)
					pyxel.pal()
Ejemplo n.º 24
0
    def draw(self):
        if self.frame == 5:
            pyxel.circ(128, 256, 4, 7)
        if self.frame == 4:
            pyxel.circ(128, 256, 5, 8)
            pyxel.circ(128, 256, 4, 7)

        if self.frame == 3:
            pyxel.circ(128, 256, 6, 2)
            pyxel.circ(128, 256, 5, 8)
            pyxel.circ(128, 256, 4, 7)

        if self.frame == 2:
            pyxel.circb(128, 256, 6, 2)
            pyxel.circb(128, 256, 5, 8)

        if self.frame == 1:
            pyxel.circb(128, 256, 6, 2)
Ejemplo n.º 25
0
 def draw(self):
     pyxel.circ(self.x, self.y, self.radius, BLAST_COLOR_IN)
     pyxel.circb(self.x, self.y, self.radius, BLAST_COLOR_OUT)
Ejemplo n.º 26
0
 def draw(self):
     # Draw the bubble
     pyxel.circb(self.x, self.y, self.radius, self.color)
Ejemplo n.º 27
0
 def pintar(self):
     pyxel.circb(self.posicao.x, self.posicao.y, self.raio, 0)
Ejemplo n.º 28
0
import pyxel

pyxel.init(160, 160)

# 画面の塗りつぶし
pyxel.cls(1)
# 長方形
pyxel.rect(5, 5, 120, 40, 13)
# 円
pyxel.circ(30, 25, 15, 11)
# 円
pyxel.circb(65, 25, 15, 1)

# 画面表示
pyxel.show()
Ejemplo n.º 29
0
 def draw(self):
     pyxel.circb(self.x, self.y, 15, 7)  #空心圆
     pyxel.rect(self.x - 10, self.y - 10, 20, 20, 13)
     pyxel.circ(self.x, self.y, 10, 10)  #实心圆
     pyxel.text(self.x - 1, self.y - 2, self.value, 8)
Ejemplo n.º 30
0
 def draw_rings(self):
     pyxel.circb(SCREEN_WIDTH / 2, SCREEN_WIDTH / 2, 128 - 16, 1)
     pyxel.circb(SCREEN_WIDTH / 2, SCREEN_WIDTH / 2, 128 - 32, 12)
     pyxel.circb(SCREEN_WIDTH / 2, SCREEN_WIDTH / 2, 128 - 48, 3)
     pyxel.circb(SCREEN_WIDTH / 2, SCREEN_WIDTH / 2, 128 - 64, 9)
     pyxel.circb(SCREEN_WIDTH / 2, SCREEN_WIDTH / 2, 128 - 80, 8)