Pygame游戏开发——《蛋糕消消乐》小游戏

Stella981
• 阅读 794

开发工具: Pycharm

游戏介绍: 玩家通过交换蛋糕的位置消除蛋糕,如果有三个或以上同样的蛋糕处于一个直线或T字形的位置,将会发生消除,并加载新的蛋糕。在规定时间内消除越多的蛋糕则分数越高。

游戏运行截图:

Pygame游戏开发——《蛋糕消消乐》小游戏

Pygame游戏开发——《蛋糕消消乐》小游戏

游戏制作步骤

一、准备素材

收集处理需要用到的素材(包括图片、声音、字体等)

Pygame游戏开发——《蛋糕消消乐》小游戏

Pygame游戏开发——《蛋糕消消乐》小游戏

二、编写代码,实现游戏界面

1.定义config.py文件存储相关参数:包括界面的宽高,整个方格行列个数,总格数等等。

参数设置:

WIDTH = 600
HEIGHT = 600
NUMGRID = 8
GRIDSIZE = 64
XMARGIN = (WIDTH - GRIDSIZE * NUMGRID) // 2
YMARGIN = (HEIGHT - GRIDSIZE * NUMGRID) // 2
ROOTDIR = os.getcwd()
FPS = 30

2.定义utils.py文件用于存放基础的类和函数:包括整个消除拼图类,游戏类,拼图块移动函数,坐标设置与获取函数,开始游戏主函数,初始化随机生成拼图函数,时间倒计时展示函数,显示得分函数,加分函数,消除函数以及消除后新拼图块生成函数,拼图交换位置函数等等。

1) 导入库:time计时,random生成随机数,pygame跨平台Python模块主要用于游戏图形化界面生成以及音频播放,config自己定义的相关变量

import sys
import time
import random
import pygame
from config import *

2) 定义拼图类

class gemSprite(pygame.sprite.Sprite):

主要有函数:

初始化函数:self=类具体化对象本身,img_path=图片文件所在路径,size=整个界面大小,position=拼图块位置,downlen=消除拼图块后下降格数

def __init__(self, img_path, size, position, downlen, **kwargs):

移动函数:主要通过鼠标控制拼图块交换方向,有上下左右四个方向

def move(self):

获取坐标函数:获取当前拼图块坐标,主要通过左(left)和上(top)两个方向定义坐标距离

def getPosition(self):

设置坐标函数:设置拼图块坐标

def setPosition(self, position):

3) 定义游戏类:

class gemGame():

主要函数有:

初始化函数:self=类具体化对象本身,screen=屏幕,sounds=音频,font=字体,gem_imgs=拼图块图片

def __init__(self, screen, sounds, font, gem_imgs, **kwargs):

开始游戏函数:游戏开始主循环

def start(self):

随机拼图块生成函数:消除后随机生成新的拼图模块

def reset(self):

显示游戏倒计时时间函数:

def showRemainingTime(self):

显示得分函数:

def drawScore(self):

分数计算函数:

def drawAddScore(self, add_score):

新拼图块生成函数:

def generateNewGems(self, res_match):

消除匹配成功的拼图块:行或列三个一样的拼图块出现即消除

def removeMatched(self, res_match):

界面网格绘制:

def drawGrids(self):

画矩形框:

def drawBlock(self, block, color=(255, 240, 245), size=4):

新的拼图块出现下落特效:

def dropGems(self, x, y):

是否每个位置都有拼图块:

def isFull(self):

检查有无拼图块被选中:

def checkSelected(self, position):

有无行列三个拼图块相同判断:

def isMatch(self):

根据坐标获取对应位置的拼图对象:

def getGemByPos(self, x, y):

交换拼图函数:

def swapGem(self, gem1_pos, gem2_pos):

3.定义main.py主函数:主要用于界面初始化开启游戏主程序

1) 导入库

import os
import pygame
from utils import *
from config import *

2) 游戏主程序定义:

def main():

主要功能:

游戏界面初始化:

pygame.init()
    size = width, height = (WIDTH,HEIGHT)
    screen = pygame.display.set_mode(size, pygame.RESIZABLE)  # 窗口模式
    bg = pygame.image.load("bg.jpg")
    screen.blit(pygame.transform.scale(bg, size), (0, 0))  # 背景能伸缩
    clock = pygame.time.Clock()
    pygame.display.set_caption('消消乐')

加载音效资源:

# 加载背景音乐
    pygame.mixer.init()
    pygame.mixer.music.load(os.path.join(ROOTDIR, "resources/audios/bg.mp3"))
    pygame.mixer.music.set_volume(0.6)
    pygame.mixer.music.play(-1)
# 加载音效
    sounds = {}
    sounds['mismatch'] = pygame.mixer.Sound(os.path.join(ROOTDIR, 'resources/audios/badswap.wav'))
    sounds['match'] = []
    for i in range(6):
        sounds['match'].append(pygame.mixer.Sound(os.path.join(ROOTDIR, 'resources/audios/match%s.wav' % i)))

加载字体资源:

font = pygame.font.Font(os.path.join(ROOTDIR, 'resources/font.TTF'), 25)

加载图片资源:

gem_imgs = []
    for i in range(1, 8):
        gem_imgs.append(os.path.join(ROOTDIR, 'resources/images/gem%s.png' % i))

游戏主循环:

game = gemGame(screen, sounds, font, gem_imgs)
    while True:
        score = game.start()
        flag = False
        # 一轮游戏结束后玩家选择重玩或者退出
        while True:
            # clock.tick(60)
            for event in pygame.event.get():
                if event.type == pygame.QUIT or (event.type == pygame.KEYUP and event.key == pygame.K_ESCAPE):
                    pygame.quit()
                    sys.exit()
                elif event.type == pygame.KEYUP and event.key == pygame.K_r:
                    size = width, height = event.size[0], event.size[1]  # 获取新的size
                    # screen = pygame.display.set_mode(size, pygame.RESIZABLE)
                    # screen.blit(pygame.transform.scale(bg, size), (0, 0))  # 背景能伸缩
                    flag = True
            if flag:
                break
            # screen.blit(back_image, (0, 0))
            # screen.fill((135, 206, 235))
            screen.blit(pygame.transform.scale(bg, size), (0, 0))  # 背景能伸缩
            pygame.display.flip()
            text0 = 'Final score: %s' % score
            text1 = 'Press <R> to restart the game.'
            text2 = 'Press <Esc> to quit the game.'
            text3 = 'Producer: KongXinger & HeJin'
            y = 150
            for idx, text in enumerate([text0, text1, text2, text3]):
                text_render = font.render(text, 1, (85, 65, 0))
                rect = text_render.get_rect()
                if idx == 0:
                    rect.left, rect.top = (212, y)
                elif idx == 1:
                    rect.left, rect.top = (122.5, y)
                elif idx == 1:
                    rect.left, rect.top = (126.5, y)
                else:
                    rect.left, rect.top = (130.5, y)
                y += 80
                screen.blit(text_render, rect)
            pygame.display.update()
        game.reset()

主程序:

if __name__ == '__main__':
    main()

三、运行测试

Pygame游戏开发——《蛋糕消消乐》小游戏

完整参考代码:

config.py

import os

WIDTH = 600
HEIGHT = 600
NUMGRID = 8
GRIDSIZE = 64
XMARGIN = (WIDTH - GRIDSIZE * NUMGRID) // 2
YMARGIN = (HEIGHT - GRIDSIZE * NUMGRID) // 2
ROOTDIR = os.getcwd()
FPS = 30

utils.py

import sys
import time
import random
import pygame
from config import *


'''拼图精灵类'''
class gemSprite(pygame.sprite.Sprite):
    def __init__(self, img_path, size, position, downlen, **kwargs):
        pygame.sprite.Sprite.__init__(self)
        self.image = pygame.image.load(img_path)
        self.image = pygame.transform.smoothscale(self.image, size)
        self.rect = self.image.get_rect()
        self.rect.left, self.rect.top = position
        self.downlen = downlen
        self.target_x = position[0]
        self.target_y = position[1] + downlen
        self.type = img_path.split('/')[-1].split('.')[0]
        self.fixed = False
        self.speed_x = 10
        self.speed_y = 10
        self.direction = 'down'
    '''拼图块移动'''
    def move(self):
        if self.direction == 'down':
            self.rect.top = min(self.target_y, self.rect.top+self.speed_y)
            if self.target_y == self.rect.top:
                self.fixed = True
        elif self.direction == 'up':
            self.rect.top = max(self.target_y, self.rect.top-self.speed_y)
            if self.target_y == self.rect.top:
                self.fixed = True
        elif self.direction == 'left':
            self.rect.left = max(self.target_x, self.rect.left-self.speed_x)
            if self.target_x == self.rect.left:
                self.fixed = True
        elif self.direction == 'right':
            self.rect.left = min(self.target_x, self.rect.left+self.speed_x)
            if self.target_x == self.rect.left:
                self.fixed = True
    '''获取坐标'''
    def getPosition(self):
        return self.rect.left, self.rect.top
    '''设置坐标'''
    def setPosition(self, position):
        self.rect.left, self.rect.top = position


'''游戏类'''
class gemGame():
    def __init__(self, screen, sounds, font, gem_imgs, **kwargs):
        self.info = 'Gemgem'
        self.screen = screen
        self.sounds = sounds
        self.font = font
        self.gem_imgs = gem_imgs
        self.reset()
    '''开始游戏'''
    def start(self):
        clock = pygame.time.Clock()
        # 遍历整个游戏界面更新位置
        overall_moving = True
        # 指定某些对象个体更新位置
        individual_moving = False
        # 定义一些必要的变量
        gem_selected_xy = None
        gem_selected_xy2 = None
        swap_again = False
        add_score = 0
        add_score_showtimes = 10
        time_pre = int(time.time())
        # 游戏主循环
        while True:
            for event in pygame.event.get():
                if event.type == pygame.QUIT or (event.type == pygame.KEYUP and event.key == pygame.K_ESCAPE):
                    pygame.quit()
                    sys.exit()
                elif event.type == pygame.MOUSEBUTTONUP:
                    if (not overall_moving) and (not individual_moving) and (not add_score):
                        position = pygame.mouse.get_pos()
                        if gem_selected_xy is None:
                            gem_selected_xy = self.checkSelected(position)
                        else:
                            gem_selected_xy2 = self.checkSelected(position)
                            if gem_selected_xy2:
                                if self.swapGem(gem_selected_xy, gem_selected_xy2):
                                    individual_moving = True
                                    swap_again = False
                                else:
                                    gem_selected_xy = None
            if overall_moving:
                overall_moving = not self.dropGems(0, 0)
                # 移动一次可能可以拼出多个3连块
                if not overall_moving:
                    res_match = self.isMatch()
                    add_score = self.removeMatched(res_match)
                    if add_score > 0:
                        overall_moving = True
            if individual_moving:
                gem1 = self.getGemByPos(*gem_selected_xy)
                gem2 = self.getGemByPos(*gem_selected_xy2)
                gem1.move()
                gem2.move()
                if gem1.fixed and gem2.fixed:
                    res_match = self.isMatch()
                    if res_match[0] == 0 and not swap_again:
                        swap_again = True
                        self.swapGem(gem_selected_xy, gem_selected_xy2)
                        self.sounds['mismatch'].play()
                    else:
                        add_score = self.removeMatched(res_match)
                        overall_moving = True
                        individual_moving = False
                        gem_selected_xy = None
                        gem_selected_xy2 = None
            self.screen.fill((135, 206, 235))
            self.drawGrids()
            self.gems_group.draw(self.screen)
            if gem_selected_xy:
                self.drawBlock(self.getGemByPos(*gem_selected_xy).rect)
            if add_score:
                if add_score_showtimes == 10:
                    random.choice(self.sounds['match']).play()
                self.drawAddScore(add_score)
                add_score_showtimes -= 1
                if add_score_showtimes < 1:
                    add_score_showtimes = 10
                    add_score = 0
            self.remaining_time -= (int(time.time()) - time_pre)
            time_pre = int(time.time())
            self.showRemainingTime()
            self.drawScore()
            if self.remaining_time <= 0:
                return self.score
            pygame.display.update()
            clock.tick(FPS)
    '''初始化'''
    def reset(self):
        # 随机生成各个块(即初始化游戏地图各个元素)
        while True:
            self.all_gems = []
            self.gems_group = pygame.sprite.Group()
            for x in range(NUMGRID):
                self.all_gems.append([])
                for y in range(NUMGRID):
                    gem = gemSprite(img_path=random.choice(self.gem_imgs), size=(GRIDSIZE, GRIDSIZE), position=[XMARGIN+x*GRIDSIZE, YMARGIN+y*GRIDSIZE-NUMGRID*GRIDSIZE], downlen=NUMGRID*GRIDSIZE)
                    self.all_gems[x].append(gem)
                    self.gems_group.add(gem)
            if self.isMatch()[0] == 0:
                break
        # 得分
        self.score = 0
        # 拼出一个的奖励
        self.reward = 10
        # 时间
        self.remaining_time = 20
    '''显示剩余时间'''
    def showRemainingTime(self):
        remaining_time_render = self.font.render('CountDown: %ss' % str(self.remaining_time), 1, (85, 65, 0))
        rect = remaining_time_render.get_rect()
        rect.left, rect.top = (WIDTH-201, 6)
        self.screen.blit(remaining_time_render, rect)
    '''显示得分'''
    def drawScore(self):
        score_render = self.font.render('SCORE:'+str(self.score), 1, (85, 65, 0))
        rect = score_render.get_rect()
        rect.left, rect.top = (10, 6)
        self.screen.blit(score_render, rect)
    '''显示加分'''
    def drawAddScore(self, add_score):
        score_render = self.font.render('+'+str(add_score), 1, (255, 100, 100))
        rect = score_render.get_rect()
        rect.left, rect.top = (250, 250)
        self.screen.blit(score_render, rect)
    '''生成新的拼图块'''
    def generateNewGems(self, res_match):
        if res_match[0] == 1:
            start = res_match[2]
            while start > -2:
                for each in [res_match[1], res_match[1]+1, res_match[1]+2]:
                    gem = self.getGemByPos(*[each, start])
                    if start == res_match[2]:
                        self.gems_group.remove(gem)
                        self.all_gems[each][start] = None
                    elif start >= 0:
                        gem.target_y += GRIDSIZE
                        gem.fixed = False
                        gem.direction = 'down'
                        self.all_gems[each][start+1] = gem
                    else:
                        gem = gemSprite(img_path=random.choice(self.gem_imgs), size=(GRIDSIZE, GRIDSIZE), position=[XMARGIN+each*GRIDSIZE, YMARGIN-GRIDSIZE], downlen=GRIDSIZE)
                        self.gems_group.add(gem)
                        self.all_gems[each][start+1] = gem
                start -= 1
        elif res_match[0] == 2:
            start = res_match[2]
            while start > -4:
                if start == res_match[2]:
                    for each in range(0, 3):
                        gem = self.getGemByPos(*[res_match[1], start+each])
                        self.gems_group.remove(gem)
                        self.all_gems[res_match[1]][start+each] = None
                elif start >= 0:
                    gem = self.getGemByPos(*[res_match[1], start])
                    gem.target_y += GRIDSIZE * 3
                    gem.fixed = False
                    gem.direction = 'down'
                    self.all_gems[res_match[1]][start+3] = gem
                else:
                    gem = gemSprite(img_path=random.choice(self.gem_imgs), size=(GRIDSIZE, GRIDSIZE), position=[XMARGIN+res_match[1]*GRIDSIZE, YMARGIN+start*GRIDSIZE], downlen=GRIDSIZE*3)
                    self.gems_group.add(gem)
                    self.all_gems[res_match[1]][start+3] = gem
                start -= 1
    '''移除匹配的gem'''
    def removeMatched(self, res_match):
        if res_match[0] > 0:
            self.generateNewGems(res_match)
            self.score += self.reward
            return self.reward
        return 0
    '''游戏界面的网格绘制'''
    def drawGrids(self):
        for x in range(NUMGRID):
            for y in range(NUMGRID):
                rect = pygame.Rect((XMARGIN+x*GRIDSIZE, YMARGIN+y*GRIDSIZE, GRIDSIZE, GRIDSIZE))
                self.drawBlock(rect, color=(255,240,245), size=1)
    '''画矩形block框'''
    def drawBlock(self, block, color=(255, 240, 245), size=4):
        pygame.draw.rect(self.screen, color, block, size)
    '''下落特效'''
    def dropGems(self, x, y):
        if not self.getGemByPos(x, y).fixed:
            self.getGemByPos(x, y).move()
        if x < NUMGRID-1:
            x += 1
            return self.dropGems(x, y)
        elif y < NUMGRID-1:
            x = 0
            y += 1
            return self.dropGems(x, y)
        else:
            return self.isFull()
    '''是否每个位置都有拼图块了'''
    def isFull(self):
        for x in range(NUMGRID):
            for y in range(NUMGRID):
                if not self.getGemByPos(x, y).fixed:
                    return False
        return True
    '''检查有无拼图块被选中'''
    def checkSelected(self, position):
        for x in range(NUMGRID):
            for y in range(NUMGRID):
                if self.getGemByPos(x, y).rect.collidepoint(*position):
                    return [x, y]
        return None
    '''是否有连续一样的三个块(无--返回0/水平--返回1/竖直--返回2)'''
    def isMatch(self):
        for x in range(NUMGRID):
            for y in range(NUMGRID):
                if x + 2 < NUMGRID:
                    if self.getGemByPos(x, y).type == self.getGemByPos(x+1, y).type == self.getGemByPos(x+2, y).type:
                        return [1, x, y]
                if y + 2 < NUMGRID:
                    if self.getGemByPos(x, y).type == self.getGemByPos(x, y+1).type == self.getGemByPos(x, y+2).type:
                        return [2, x, y]
        return [0, x, y]
    '''根据坐标获取对应位置的拼图对象'''
    def getGemByPos(self, x, y):
        return self.all_gems[x][y]
    '''交换拼图'''
    def swapGem(self, gem1_pos, gem2_pos):
        margin = gem1_pos[0] - gem2_pos[0] + gem1_pos[1] - gem2_pos[1]
        if abs(margin) != 1:
            return False
        gem1 = self.getGemByPos(*gem1_pos)
        gem2 = self.getGemByPos(*gem2_pos)
        if gem1_pos[0] - gem2_pos[0] == 1:
            gem1.direction = 'left'
            gem2.direction = 'right'
        elif gem1_pos[0] - gem2_pos[0] == -1:
            gem2.direction = 'left'
            gem1.direction = 'right'
        elif gem1_pos[1] - gem2_pos[1] == 1:
            gem1.direction = 'up'
            gem2.direction = 'down'
        elif gem1_pos[1] - gem2_pos[1] == -1:
            gem2.direction = 'up'
            gem1.direction = 'down'
        gem1.target_x = gem2.rect.left
        gem1.target_y = gem2.rect.top
        gem1.fixed = False
        gem2.target_x = gem1.rect.left
        gem2.target_y = gem1.rect.top
        gem2.fixed = False
        self.all_gems[gem2_pos[0]][gem2_pos[1]] = gem1
        self.all_gems[gem1_pos[0]][gem1_pos[1]] = gem2
        return True
    '''info'''
    def __repr__(self):
        return self.info

main.py

import os
import pygame
from utils import *
from config import *


'''游戏主程序'''
def main():
    pygame.init()
    # screen = pygame.display.set_mode((WIDTH, HEIGHT))
    # back_image = pygame.image.load('bg.jpg')
    size = width, height = (WIDTH,HEIGHT)
    screen = pygame.display.set_mode(size, pygame.RESIZABLE)  # 窗口模式
    bg = pygame.image.load("bg.jpg")
    screen.blit(pygame.transform.scale(bg, size), (0, 0))  # 背景能伸缩
    clock = pygame.time.Clock()
    pygame.display.set_caption('消消乐')
    # 加载背景音乐
    pygame.mixer.init()
    pygame.mixer.music.load(os.path.join(ROOTDIR, "resources/audios/bg.mp3"))
    pygame.mixer.music.set_volume(0.6)
    pygame.mixer.music.play(-1)
    # 加载音效
    sounds = {}
    sounds['mismatch'] = pygame.mixer.Sound(os.path.join(ROOTDIR, 'resources/audios/badswap.wav'))
    sounds['match'] = []
    for i in range(6):
        sounds['match'].append(pygame.mixer.Sound(os.path.join(ROOTDIR, 'resources/audios/match%s.wav' % i)))
    # 加载字体
    font = pygame.font.Font(os.path.join(ROOTDIR, 'resources/font.TTF'), 25)
    # 图片加载
    gem_imgs = []
    for i in range(1, 8):
        gem_imgs.append(os.path.join(ROOTDIR, 'resources/images/gem%s.png' % i))
    # 主循环
    game = gemGame(screen, sounds, font, gem_imgs)
    while True:
        score = game.start()
        flag = False
        # 一轮游戏结束后玩家选择重玩或者退出
        while True:
            # clock.tick(60)
            for event in pygame.event.get():
                if event.type == pygame.QUIT or (event.type == pygame.KEYUP and event.key == pygame.K_ESCAPE):
                    pygame.quit()
                    sys.exit()
                elif event.type == pygame.KEYUP and event.key == pygame.K_r:
                    size = width, height = event.size[0], event.size[1]  # 获取新的size
                    # screen = pygame.display.set_mode(size, pygame.RESIZABLE)
                    # screen.blit(pygame.transform.scale(bg, size), (0, 0))  # 背景能伸缩
                    flag = True
            if flag:
                break
            # screen.blit(back_image, (0, 0))
            # screen.fill((135, 206, 235))
            screen.blit(pygame.transform.scale(bg, size), (0, 0))  # 背景能伸缩
            pygame.display.flip()
            text0 = 'Final score: %s' % score
            text1 = 'Press <R> to restart the game.'
            text2 = 'Press <Esc> to quit the game.'
            text3 = 'Producer: KongXinger & HeJin'
            y = 150
            for idx, text in enumerate([text0, text1, text2, text3]):
                text_render = font.render(text, 1, (85, 65, 0))
                rect = text_render.get_rect()
                if idx == 0:
                    rect.left, rect.top = (212, y)
                elif idx == 1:
                    rect.left, rect.top = (122.5, y)
                elif idx == 1:
                    rect.left, rect.top = (126.5, y)
                else:
                    rect.left, rect.top = (130.5, y)
                y += 80
                screen.blit(text_render, rect)
            pygame.display.update()
        game.reset()


'''test'''
if __name__ == '__main__':
    main()

学习参考:简书博主JackHCC

点赞
收藏
评论区
推荐文章
Easter79 Easter79
3年前
three.js
第1章课程介绍介绍了微信小游戏的概念以及相关的由来,从宏观上对于微信小游戏的定位和价值有一个明确的认识第2章微信小游戏平台与特性讲了微信小游戏平台的相关特性,包括微信小游戏工程的建立,微信小游戏开发工具的详细使用,以及微信小游戏相关API的实战等第3章THREEJS与WebGL核心概念通过理论和实战,讲解了什么是webgl、什
梦
3年前
list集合的一些处理
做了一个消消乐类似的小游戏,其中需要打乱部分内容,用的list打乱的方式,特此笔记Collections.sort(list);//顺序排列System.out.println(list);Collections.shuffle(list);//混乱的意思System.out.println(list);
wnm wnm
2年前
码上就送万能码(安全扫码专业委员会)
鸡蛋看着其貌不扬,生活中处处可见,但却发挥着大作用,基本上每个人每天都跟鸡蛋扯上关系,蛋糕、番茄炒蛋、蒸蛋、煮蛋还有各种蛋制品。码上送鸡蛋,免费营养的土鸡蛋。
Wesley13 Wesley13
3年前
2D小游戏开发学习笔记(5)
一、围住神经猫游戏游戏玩法:玩法很简单,蓝色圆圈代表神经猫,通过点击周围圆圈把猫困住,就算游戏成功游戏效果!(https://oscimg.oschina.net/oscnet/up968a35abafe07c092eacca8126719e14a50.png)逻辑梳理:1、
Wesley13 Wesley13
3年前
JAVA专业好还是C语言专业好,哪个编程语言好就业?
Java可以算是从C发展而来的,所以语法和C很相似,但既然是升级,所以必定涵盖了很多C的东西,所以这两种语言,只需学其一即可,java尤善用些。Java是面向对象的,C是面向过程的,就好像说做蛋糕,最早时期只能用手一个个塑形,就好比于C语言,而后有人发明了蛋糕模子,然后就可以不用每一个都捏一下了,这就好比与Java语言,这种方
Wesley13 Wesley13
3年前
HTML5游戏开发实例
开发工具:vscode一、人物拼图游戏游戏介绍:拼图游戏将一幅图片分割成若干拼块并将它们随机打乱顺序。当将所有拼块都放回原位置时,就完成了拼图(游戏结束)。在“游戏”中,单击滑块选择游戏难易,“容易”为3行3列拼图游戏,中间为一个4行4列拼图游戏,“难”为5行5列拼图游戏。拼块以随机顺序排列,玩家用鼠标单击空
Stella981 Stella981
3年前
Egret白鹭开发微信小游戏程序跳转功能(由一个小游戏跳转到另一个小游戏)
假设我们要实现的功能是从小游戏A跳转到小游戏B对于小游戏A:(1)在platform.ts中添加代码如下:!(https://oscimg.oschina.net/oscnet/7b57e0521728aa535881f153dee952fb118.png)/平台数据接口。由于每款游戏
Wesley13 Wesley13
3年前
H5游戏开发:消灭星星
!(https://oscimg.oschina.net/oscnet/692dff28ece01d2dd30837163888614fa74.jpg)「消灭星星」是一款很经典的「消除类游戏」,它的玩法很简单:消除相连通的同色砖块。!(https://oscimg.oschina.net/oscnet/9485c4f0cce55747fe0c
盘点五大实用开源商城系统
当下应该是属于电商的时代,网上购物已经成功的改变了大家的消费模式,越来越多的企业想要在电商领域中掘金,抢占属于自己市场蛋糕。而这个时候应当挑选一款靠谱的网上商城系统,以期更好的完成相应的网上销售,获取利润。现在商城系统非常多,相关的解决方案已经发展的非常成熟了至于哪一个系统做的比较好,每个人的侧重点不一样,所以都建议都去试一试,沟通一下。不一定要最好的,从价