国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

這篇具有很好參考價(jià)值的文章主要介紹了【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問。

導(dǎo)語

大家以前應(yīng)該都聽說過一個(gè)游戲:叫做走四棋兒

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

這款游戲出來到現(xiàn)在時(shí)間挺長了,小時(shí)候的家鄉(xiāng)農(nóng)村條件有限,附近也沒有正式的玩具店能買

到玩具,因此小朋友們聚在一起玩耍時(shí),其玩具大多都是就地取材的。

直接在家里的水泥地上用燒完的炭火灰畫出幾條線,擺上幾顆石頭子即可。當(dāng)時(shí)的火爆程度可

謂是達(dá)到了一個(gè)新的高度。包括我當(dāng)時(shí)也比較喜歡這款游戲。因?yàn)闀r(shí)間推移,小時(shí)候很多游戲

都已經(jīng)在現(xiàn)在這個(gè)時(shí)代看不到啦!

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

今天小編就帶大家追憶童年——一起敲一敲《走四棋兒》小游戲,你小時(shí)候還玩兒過那些游戲

呢?(抓石頭、跳繩、丟手絹兒 .......捂臉.jpg)

所有文章完整的素材+源碼都在????

粉絲白嫖源碼福利,請(qǐng)移步至CSDN社區(qū)或文末公眾hao即可免費(fèi)。

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

正文

一、游戲解說

“走四兒”大部分活躍在山東濟(jì)南、聊城、菏澤等地,是一種棋類游戲,特別適合兒童試玩。

在一個(gè)4×4的棋盤上,雙方各有4子,分別擺放在棋盤兩個(gè)最上面的兩端線的四個(gè)位置上。下圖

就是“走四兒”開局的樣子。

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

二、游戲規(guī)則

“走四兒”的游戲規(guī)則是:

1.雙方輪流走,每一步只能在上下左右中的一個(gè)無子的方向上走一個(gè)格,不能斜走。如果一方

無法移動(dòng),則由另一方走。

2.當(dāng)甲方的一個(gè)子移動(dòng)到一條線上之后,這條線上只有甲方的兩個(gè)子和乙方的一個(gè)子,且甲方

的這兩子相連,乙方的子與甲方那兩子中的一個(gè)子相連,那么乙方的這個(gè)子就被吃掉。

下圖是可以吃子的樣式例舉:

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

3.少于2個(gè)子的一方為輸者。雙方都無法勝對(duì)方就可以認(rèn)為是和棋。

三、環(huán)境安裝

?1)素材(圖片)?

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

?2)運(yùn)行環(huán)境

小編使用的環(huán)境:Python3、Pycharm社區(qū)版、Pygame、?numpy模塊部分自帶就不一一 展示啦。?

 模塊安裝:pip install -i https://pypi.douban.com/simple/+模塊名

四、代碼展示

import pygame as pg
from pygame.locals import *
import sys
import time
import numpy as np

pg.init()
size = width, height = 600, 400
screen = pg.display.set_mode(size)
f_clock = pg.time.Clock()
fps = 30
pg.display.set_caption("走四棋兒")
background = pg.image.load("background.png").convert_alpha()
glb_pos = [[(90, 40), (190, 40), (290, 40), (390, 40)],
           [(90, 140), (190, 140), (290, 140), (390, 140)],
           [(90, 240), (190, 240), (290, 240), (390, 240)],
           [(90, 340), (190, 340), (290, 340), (390, 340)]]


class ChessPieces():
    def __init__(self, img_name):
        self.name = img_name
        self.id = None
        if self.name == 'heart':
            self.id = 2
        elif self.name == 'spade':
            self.id = 3
        self.img = pg.image.load(img_name + ".png").convert_alpha()
        self.rect = self.img.get_rect()
        self.pos_x, self.pos_y = 0, 0
        self.alive_state = True

    def get_rect(self):
        return (self.rect[0], self.rect[1])

    def get_pos(self):
        return (self.pos_x, self.pos_y)

    def update(self):
        if self.alive_state == True:
            self.rect[0] = glb_pos[self.pos_y][self.pos_x][0]
            self.rect[1] = glb_pos[self.pos_y][self.pos_x][1]
            screen.blit(self.img, self.rect)


class Pointer():
    def __init__(self):
        self.img = pg.image.load("pointer.png").convert_alpha()
        self.rect = self.img.get_rect()
        self.show = False
        self.selecting_item = False

    def point_to(self, Heart_Blade_class):
        if Heart_Blade_class.alive_state:
            self.pointing_to_item = Heart_Blade_class
            self.item_pos = Heart_Blade_class.get_rect()
            self.rect[0], self.rect[1] = self.item_pos[0], self.item_pos[1] - 24

    def update(self):
        screen.blit(self.img, self.rect)


class GlobalSituation():
    def __init__(self):
        self.glb_situation = np.array([[2, 2, 2, 2],
                                       [0, 0, 0, 0],
                                       [0, 0, 0, 0],
                                       [3, 3, 3, 3]], dtype=np.uint8)
        self.spade_turn = None

    def refresh_situation(self):
        self.glb_situation = np.zeros([4, 4], np.uint8)
        for i in range(4):
            if heart[i].alive_state:
                self.glb_situation[heart[i].pos_y, heart[i].pos_x] = heart[i].id
        for i in range(4):
            if spade[i].alive_state:
                self.glb_situation[spade[i].pos_y, spade[i].pos_x] = spade[i].id
        for i in range(4):
            print(self.glb_situation[i][:])
        print('=' * 12)
        if self.spade_turn != None:
            self.spade_turn = not self.spade_turn

    def check_situation(self, moved_item):
        curr_pos_x, curr_pos_y = moved_item.get_pos()
        curr_pos_col = self.glb_situation[:, curr_pos_x]
        curr_pos_raw = self.glb_situation[curr_pos_y, :]
        enemy_die = False
        if moved_item.id == 2:
            if np.sum(curr_pos_col) == 7:
                if (curr_pos_col == np.array([0, 2, 2, 3])).all():
                    enemy_die = True
                    self.glb_situation[3, curr_pos_x] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == curr_pos_x and spade_i.pos_y == 3:
                            spade_i.alive_state = False
                elif (curr_pos_col == np.array([2, 2, 3, 0])).all():
                    enemy_die = True
                    self.glb_situation[2, curr_pos_x] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == curr_pos_x and spade_i.pos_y == 2:
                            spade_i.alive_state = False
                elif (curr_pos_col == np.array([0, 3, 2, 2])).all():
                    enemy_die = True
                    self.glb_situation[1, curr_pos_x] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == curr_pos_x and spade_i.pos_y == 1:
                            spade_i.alive_state = False
                elif (curr_pos_col == np.array([3, 2, 2, 0])).all():
                    enemy_die = True
                    self.glb_situation[0, curr_pos_x] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == curr_pos_x and spade_i.pos_y == 0:
                            spade_i.alive_state = False
            if np.sum(curr_pos_raw) == 7:
                if (curr_pos_raw == np.array([0, 2, 2, 3])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 3] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == 3 and spade_i.pos_y == curr_pos_y:
                            spade_i.alive_state = False
                elif (curr_pos_raw == np.array([2, 2, 3, 0])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 2] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == 2 and spade_i.pos_y == curr_pos_y:
                            spade_i.alive_state = False
                elif (curr_pos_raw == np.array([0, 3, 2, 2])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 1] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == 1 and spade_i.pos_y == curr_pos_y:
                            spade_i.alive_state = False
                elif (curr_pos_raw == np.array([3, 2, 2, 0])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 0] = 0
                    for spade_i in spade:
                        if spade_i.alive_state and spade_i.pos_x == 0 and spade_i.pos_y == curr_pos_y:
                            spade_i.alive_state = False
        elif moved_item.id == 3:
            if np.sum(curr_pos_col) == 8:
                if (curr_pos_col == np.array([0, 3, 3, 2])).all():
                    enemy_die = True
                    self.glb_situation[3, curr_pos_x] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == curr_pos_x and heart_i.pos_y == 3:
                            heart_i.alive_state = False
                elif (curr_pos_col == np.array([3, 3, 2, 0])).all():
                    enemy_die = True
                    self.glb_situation[2, curr_pos_x] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == curr_pos_x and heart_i.pos_y == 2:
                            heart_i.alive_state = False
                elif (curr_pos_col == np.array([0, 2, 3, 3])).all():
                    enemy_die = True
                    self.glb_situation[1, curr_pos_x] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == curr_pos_x and heart_i.pos_y == 1:
                            heart_i.alive_state = False
                elif (curr_pos_col == np.array([2, 3, 3, 0])).all():
                    enemy_die = True
                    self.glb_situation[0, curr_pos_x] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == curr_pos_x and heart_i.pos_y == 0:
                            heart_i.alive_state = False
            if np.sum(curr_pos_raw) == 8:
                if (curr_pos_raw == np.array([0, 3, 3, 2])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 3] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == 3 and heart_i.pos_y == curr_pos_y:
                            heart_i.alive_state = False
                elif (curr_pos_raw == np.array([3, 3, 2, 0])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 2] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == 2 and heart_i.pos_y == curr_pos_y:
                            heart_i.alive_state = False
                elif (curr_pos_raw == np.array([0, 2, 3, 3])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 1] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == 1 and heart_i.pos_y == curr_pos_y:
                            heart_i.alive_state = False
                elif (curr_pos_raw == np.array([2, 3, 3, 0])).all():
                    enemy_die = True
                    self.glb_situation[curr_pos_y, 0] = 0
                    for heart_i in heart:
                        if heart_i.alive_state and heart_i.pos_x == 0 and heart_i.pos_y == curr_pos_y:
                            heart_i.alive_state = False
        if enemy_die == True:
            self.glb_situation = np.zeros([4, 4], np.uint8)
            for i in range(4):
                if heart[i].alive_state:
                    self.glb_situation[heart[i].pos_y, heart[i].pos_x] = heart[i].id
            for i in range(4):
                if spade[i].alive_state:
                    self.glb_situation[spade[i].pos_y, spade[i].pos_x] = spade[i].id
            for i in range(4):
                print(self.glb_situation[i][:])
            print('=' * 12)

    def check_game_over(self):
        heart_alive_num, spade_alive_num = 0, 0
        for heart_i in heart:
            if heart_i.alive_state:
                heart_alive_num += 1
        for spade_i in spade:
            if spade_i.alive_state:
                spade_alive_num += 1
        if heart_alive_num <= 1:
            print('Spades win!')
            GlobalSituation.__init__(self)
            Pointer.__init__(self)
            chess_pieces_init()
        if spade_alive_num <= 1:
            print('Hearts win!')
            GlobalSituation.__init__(self)
            Pointer.__init__(self)
            chess_pieces_init()


heart, spade = [None] * 4, [None] * 4
for i in range(4):
    heart[i] = ChessPieces('heart')
    spade[i] = ChessPieces('spade')


def chess_pieces_init():
    for i in range(4):
        heart[i].pos_y, heart[i].pos_x = 0, i
        spade[i].pos_y, spade[i].pos_x = 3, i
        heart[i].alive_state = True
        spade[i].alive_state = True

chess_pieces_init()
pointer = Pointer()
situation = GlobalSituation()


def check_click_item(c_x, c_y):
    selected_item = None
    if situation.spade_turn==None:
        for heart_i in heart:
            if heart_i.alive_state and heart_i.rect.collidepoint(c_x, c_y):
                situation.spade_turn = False
                selected_item = heart_i

        for spade_i in spade:
            if spade_i.alive_state and spade_i.rect.collidepoint(c_x, c_y):
                situation.spade_turn = True
                selected_item = spade_i

    else:
        if situation.spade_turn:
            for spade_i in spade:
                if spade_i.alive_state and spade_i.rect.collidepoint(c_x, c_y):
                    selected_item = spade_i
        else:
            for heart_i in heart:
                if heart_i.alive_state and heart_i.rect.collidepoint(c_x, c_y):
                    selected_item = heart_i
    return selected_item


def move_to_dst_pos(selected_item, c_x, c_y):
    update_situation = False
    enemy_exist = False
    if selected_item.name == 'heart':
        for spade_i in spade:
            if spade_i.rect.collidepoint(c_x, c_y) and spade_i.alive_state:
                enemy_exist = True
    elif selected_item.name == 'spade':
        for heart_i in heart:
            if heart_i.rect.collidepoint(c_x, c_y) and heart_i.alive_state:
                enemy_exist = True
    if enemy_exist == False:
        delta_y, delta_x = c_y - selected_item.rect[1], c_x - selected_item.rect[0]
        if 80 <= abs(delta_x) <= 120 and abs(delta_y) <= 20:
            if delta_x < 0:
                if selected_item.pos_x > 0:
                    selected_item.pos_x -= 1
            else:
                if selected_item.pos_x < 3:
                    selected_item.pos_x += 1
            update_situation = True
        if 80 <= abs(delta_y) <= 120 and abs(delta_x) <= 20:
            if delta_y < 0:
                if selected_item.pos_y > 0:
                    selected_item.pos_y -= 1
            else:
                if selected_item.pos_y < 3:
                    selected_item.pos_y += 1
            update_situation = True
    return update_situation


while True:
    for event in pg.event.get():
        if event.type == pg.QUIT:
            sys.exit()
        elif event.type == pg.MOUSEBUTTONDOWN:
            cursor_x, cursor_y = pg.mouse.get_pos()
            clicked_item = check_click_item(cursor_x, cursor_y)
            if clicked_item != None:
                pointer.selecting_item = True
                pointer.point_to(clicked_item)
            else:
                if pointer.selecting_item:
                    update_situation_flag = move_to_dst_pos(pointer.pointing_to_item, cursor_x, cursor_y)
                    if update_situation_flag:
                        situation.refresh_situation()
                        situation.check_situation(pointer.pointing_to_item)
                        situation.check_game_over()
                pointer.selecting_item = False
    screen.blit(background, (0, 0))
    for heart_i in heart:
        heart_i.update()
    for spade_i in spade:
        spade_i.update()
    if pointer.selecting_item:
        pointer.update()
    f_clock.tick(fps)
    pg.display.update()

五、效果展示

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)

?是不是效果跟上面的示例圖很像啦~棋子效果太死板啦!感覺會(huì)更加好看點(diǎn)兒撒!小編只是把雙

方的棋子換成了紅心??跟黑桃?啦!大家可以自己更換的哈~

走棋的效果我就不一一展示了哈,跟著游戲規(guī)則大家可以自己來探索哦!

總結(jié)

想起這些童年的棋盤游戲真是又興奮又疲憊,興奮地是童年趣事那么歡樂,疲憊的是長大后發(fā)

現(xiàn)童年“狼心狗肺”一樣的玩耍再也一去不復(fù)返。

好啦!不說那些“傷感”的話題了,游戲源碼給你們,開心一下叭??

??完整的免費(fèi)源碼領(lǐng)取處:找我吖!文末公眾hao可自行領(lǐng)取,滴滴我也可!

??推薦往期文章——

項(xiàng)目0.1? 末世生存游戲

【Pygame實(shí)戰(zhàn)】末世來臨,真正從零開始的殘酷生存游戲,你能活多久?

項(xiàng)目1.0? 泡泡機(jī)游戲

?【Pygame實(shí)戰(zhàn)】超有趣的泡泡游戲來襲——愿你童心不泯,永遠(yuǎn)快樂簡單哦~

項(xiàng)目8.1? ?《籃球“王子”》小游戲

?【Pygame實(shí)戰(zhàn)】趣味籃球——迎“籃”而上 ,樂在“球”中,喜歡打籃球的小可愛前來報(bào)道~

項(xiàng)目7.3? 想滅病毒保衛(wèi)城市》游戲

【Pygame實(shí)戰(zhàn)】疫情期間給不能出門的你推薦一款爽游 《消滅病毒保衛(wèi)城市》【強(qiáng)推】愿早日結(jié)束

項(xiàng)目5.8? 翻牌小游戲

Pygame實(shí)戰(zhàn):記憶差怎么辦?別急,增強(qiáng)記憶力的小游戲送給你~【越玩越上癮】

??文章匯總——

項(xiàng)目1.0?Python—2021 |已有文章匯總 | 持續(xù)更新,直接看這篇就夠了

(更多內(nèi)容+源碼都在文章匯總哦?。g迎閱讀~)

【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)文章來源地址http://www.zghlxwxcb.cn/news/detail-449043.html

到了這里,關(guān)于【Pygame實(shí)戰(zhàn)】懷舊經(jīng)典—這款給娃的棋類游戲,你還記得叫什么吧?(一定要收藏)的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • 樂趣無限:10款基于Pygame的經(jīng)典游戲合集

    樂趣無限:10款基于Pygame的經(jīng)典游戲合集

    游戲開發(fā)一直是許多程序員和游戲愛好者追求的夢(mèng)想。而Pygame作為一款功能強(qiáng)大的游戲開發(fā)庫,為我們提供了實(shí)現(xiàn)各種有趣游戲的工具和接口。在本文中,我將向大家介紹10款基于Pygame的經(jīng)典游戲合集,從簡單的猜數(shù)字到刺激的飛機(jī)大戰(zhàn),讓我們一起探索這個(gè)無限樂趣的游戲

    2024年02月11日
    瀏覽(94)
  • 【pygame游戲開發(fā)】這幾個(gè)經(jīng)典游戲,小紅書Python面試題目

    【pygame游戲開發(fā)】這幾個(gè)經(jīng)典游戲,小紅書Python面試題目

    pygame.time.set_timer(change_hole_event, 800) mole = Mole(cfg.MOLE_IMAGEPATHS, hole_pos) hammer = Hammer(cfg.HAMMER_IMAGEPATHS, (500, 250)) clock = pygame.time.Clock() your_score = 0 flag = False init_time = pygame.time.get_ticks() while True: time_remain = round((61000 - (pygame.time.get_ticks() - init_time)) / 1000.) if time_remain == 40 and not flag: hole

    2024年04月25日
    瀏覽(117)
  • 【pygame游戲開發(fā)】這幾個(gè)經(jīng)典游戲,勾起了少年的快樂

    【pygame游戲開發(fā)】這幾個(gè)經(jīng)典游戲,勾起了少年的快樂

    嗨嘍,大家好呀~這里是愛看美女的茜茜吶 今天給大家分享幾個(gè)好玩有趣的小游戲, 既提升了學(xué)習(xí)的興趣,又提升了學(xué)習(xí)效率,告別枯燥的學(xué)習(xí)。 python 3.8: 解釋器 pycharm: 代碼編輯器 一、飛機(jī)大戰(zhàn) 1. 所需素材 字體 圖片 音樂 2. 源碼部分 模塊導(dǎo)入 游戲界面 主函數(shù) 3. 效果展示

    2024年02月03日
    瀏覽(98)
  • Python版經(jīng)典小游戲憤怒的小鳥源代碼,基于pygame+pymunk

    Python版經(jīng)典小游戲憤怒的小鳥源代碼,基于pygame+pymunk

    Python版經(jīng)典小游戲憤怒的小鳥源代碼,基于pygame+pymunk 程序依賴:pygame 2.0.1, pymunk 5.5.0 直接運(yùn)行main.py 完整代碼下載地址:Python版經(jīng)典小游戲憤怒的小鳥源代碼 tool.py 完整代碼下載地址:Python版經(jīng)典小游戲憤怒的小鳥源代碼

    2024年02月16日
    瀏覽(104)
  • 【PyGame】Rect類實(shí)戰(zhàn)演示

    【PyGame】Rect類實(shí)戰(zhàn)演示

    Rect是pygame中很重要的一個(gè)類,矩形、橢圓以及圓弧的繪制均需要通過Rect來指定,其構(gòu)造函數(shù)要求輸入四個(gè)參數(shù),分別是(left, top, width, height),即左、上坐標(biāo)、寬度以及高度。 下面基于Rect對(duì)象來創(chuàng)建一個(gè)矩形,并通過ijkl四個(gè)鍵對(duì)其挪動(dòng),效果如下 代碼為 其中,player是一個(gè)

    2024年02月04日
    瀏覽(88)
  • 原型圖都可以用什么軟件做?分享這9款給你

    原型圖都可以用什么軟件做?分享這9款給你

    設(shè)計(jì)師在進(jìn)行原型設(shè)計(jì)師時(shí),會(huì)使用原型圖軟件,從產(chǎn)生想法到向開發(fā)人員提交項(xiàng)目。無論是構(gòu)建基本線框還是功能齊全的原型,原型圖軟件都可以為你節(jié)省大量的時(shí)間和精力。 如果你是這個(gè)領(lǐng)域的新手或者想更新你的原型圖軟件包, 請(qǐng)快速看一下這9個(gè)原型圖軟件的分享

    2024年02月10日
    瀏覽(90)
  • 適合新手小白練習(xí)的pygame實(shí)戰(zhàn)項(xiàng)目!

    適合新手小白練習(xí)的pygame實(shí)戰(zhàn)項(xiàng)目!

    PyGame是一個(gè)用于制作2D游戲的Python庫。它提供了許多功能,如游戲開發(fā)、音頻處理和圖形渲染等。PyGame庫可用于制作各種類型的游戲,從簡單的休閑游戲到復(fù)雜的冒險(xiǎn)游戲。 跨平臺(tái):pygame可以在Windows、Mac和Linux等操作系統(tǒng)上運(yùn)行。 開源:pygame是一個(gè)開源庫,開發(fā)者可以免費(fèi)使

    2024年01月25日
    瀏覽(87)
  • 【pygame學(xué)習(xí)+實(shí)戰(zhàn)】第一篇:游戲最小系統(tǒng)

    【pygame學(xué)習(xí)+實(shí)戰(zhàn)】第一篇:游戲最小系統(tǒng)

    14天學(xué)習(xí)訓(xùn)練營導(dǎo)師課程: 李寧《Python Pygame游戲開發(fā)入門與實(shí)戰(zhàn)》 李寧《計(jì)算機(jī)視覺OpenCV Python項(xiàng)目實(shí)戰(zhàn)》1 李寧《計(jì)算機(jī)視覺OpenCV Python項(xiàng)目實(shí)戰(zhàn)》2 李寧《計(jì)算機(jī)視覺OpenCV Python項(xiàng)目實(shí)戰(zhàn)》3 “我有一個(gè)夢(mèng)想,那就是有生之年做出一款屬于自己的游戲?!?不知道屏幕前的你是

    2023年04月19日
    瀏覽(98)
  • python實(shí)戰(zhàn)指西<1>pygame安裝,以及vscode

    python實(shí)戰(zhàn)指西<1>pygame安裝,以及vscode

    目錄 1,安裝pygame 1.1,(如果前一個(gè)沒反應(yīng)的化) 1.2如果飄紅字 1,檢查是否開了網(wǎng)絡(luò)代理(不要開) 2,檢查是否有pip模塊更新需要 2.這里順便記錄一下vscode 蛇蛇的環(huán)境搭載 2.1首先在vscode里下載Python插件 ?2.2win系統(tǒng): 2.3關(guān)于運(yùn)行時(shí)飆紅的字 一般十分簡單,命令窗口執(zhí)行如

    2023年04月08日
    瀏覽(86)
  • 【python大作業(yè)】pygame實(shí)戰(zhàn)(python編寫2048小游戲)

    【python大作業(yè)】pygame實(shí)戰(zhàn)(python編寫2048小游戲)

    本文介紹基于pygame編寫的2048小游戲程序 包含四個(gè)文件 運(yùn)行效果: 點(diǎn)擊此處下載完整程序,下載即可運(yùn)行 其中config.py用于設(shè)置游戲參數(shù) 包括游戲窗口大小,刷新率,方塊顏色等 game.py中定義了游戲?qū)崿F(xiàn)的函數(shù),設(shè)置方塊的產(chǎn)生,移動(dòng)與計(jì)算,并判斷游戲進(jìn)行的程度,判斷游

    2024年02月13日
    瀏覽(93)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包