找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 12117|回复: 1

[求助] 我在游戏里用了pygame怎么回到renpy界面里面来

[复制链接]
发表于 2019-8-8 18:21:54 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
renpy:
[RenPy] 纯文本查看 复制代码
init python:

     import game

 

label start:

    "h""aaaaaaaa"

    "j""bbbbbbbb"

    $game.main()#调用main函数启动

    scene rr

    "m""ccccccccccc"

    return


python:
[RenPy] 纯文本查看 复制代码
import random

import renpy, os

import pygame, sys

from pygame.locals import *

from random import randint



def main():

 pygame.init()

 main = pygame.display.set_mode((800,600))

 pygame.display.set_caption('游戏')



 bg = pygame.image.load(os.path.join(renpy.game.basepath, "bg.jpg"))

 te = pygame.image.load(os.path.join(renpy.game.basepath, "te.png"))

 text = pygame.font.SysFont("SimHei", 35)



 clock = pygame.time.Clock()

 time_passed = clock.tick()

 time_passed = clock.tick(60)

 bombs = []

 bads = []

 FPS = 60

 a = 500

 while True:

    x, y = pygame.mouse.get_pos()

    if x > 499:

      x = 499

    x = x - 100

    if y > 329:

      y = 329 

    y = y - 100

    x = x + 25

    a = a - 1

    main.blit(bg,(0,0))

    for event in pygame.event.get():

        if event.type == QUIT:

             return

    main.blit(te,(x,y))

    pygame.display.update()

    pygame.time.delay(FPS)


 楼主| 发表于 2019-8-8 21:31:44 | 显示全部楼层
就是按了关闭键就黑屏要按f11才能继续游戏
回复 支持 抱歉

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|RenPy中文空间 ( 苏ICP备17067825号|苏公网安备 32092302000068号 )

GMT+8, 2024-4-26 17:48 , Processed in 0.068613 second(s), 14 queries , File On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表