Skip to main content

A lightweight 2D/3D game engine based on Ursina

Project description

帮助文档(中文版)

  • 创建窗口

PyToolsgr.OS(OS) # Windows , MacOS , Linux

game = PyToolsgr.game(分辨率数组,是否全屏,窗口标题,是否可以调整窗口大小,最大帧率,是否显示帧率,是否开启物理引擎,2d或3d)

''' from PyToolsgr import * PyToolsgr.OS('Windows') # 或MacOS , Linux

x = (1080,720) # 窗口大小 all = True # 是否全屏 title = 'PyToolsgr' # 窗口标题 y = True # 是否可以调整窗口大小 fps = 60 # 最大帧率 fpsx = True # 是否显示帧率 phy = True # 是否开启物理引擎 mode = '2d' # 2d或3d

game = PyToolsgr.game(x,all,title,y,fps,fpsx,phy,mode)

game.run() '''

Help Documentation (English Version)

  • Create Window

PyToolsgr.OS(OS) # Windows , MacOS , Linux

game = PyToolsgr.game(resolution_array,fullscreen,window_title,resizable,max_fps,show_fps,enable_physics,2d_or_3d)

''' from PyToolsgr import * PyToolsgr.OS('Windows') # or MacOS , Linux

x = (1080,720) # window size all = True # fullscreen title = 'PyToolsgr' # window title y = True # resizable fps = 60 # max fps fpsx = True # show fps phy = True # enable physics mode = '2d' # 2d or 3d

game = PyToolsgr.game(x,all,title,y,fps,fpsx,phy,mode)

game.run() '''

from youtube:Block_Nest , bilibili:方块之巢 # PyToolsgr - 2D/3D Game Engine based on Ursina

PyToolsgr是一个基于Ursina的轻量级2/3D游戏引擎,旨在简化游戏开发流程,提供直观的API和丰富的功能。

特性

  • 🎮 简单易用的2D/3D游戏开发API
  • 🚀 基于Ursina引擎,继承其高性能和灵活性
  • 📦 开箱即用的游戏对象和组件系统
  • 🎨 内置精灵、动画、粒子效果支持
  • 🎯 碰撞检测和物理系统
  • 🎵 音频管理
  • 📱 跨平台支持(Windows, MacOS, Linux)
  • 📖 详细的文档和示例

安装

通过pip安装PyToolsgr:

pip install PyToolsgr

快速开始

创建窗口

from PyToolsgr import PyToolsgr

# 设置操作系统
PyToolsgr.OS('Windows')

# 窗口参数
resolution = (1080, 720)  # 窗口大小
fullscreen = False      # 是否全屏
title = 'PyToolsgr'     # 窗口标题
resizable = True        # 是否可以调整窗口大小
fps_limit = 60          # 最大帧率
show_fps = True         # 是否显示帧率
physics = True          # 是否开启物理引擎
mode = '2d'             # 2d或3d

# 创建游戏窗口
game = PyToolsgr.game(
    resolution=resolution,
    fullscreen=fullscreen,
    title=title,
    resizable=resizable,
    fps_limit=fps_limit,
    show_fps=show_fps,
    physics=physics,
    mode=mode
)

# 运行游戏
game.run()

核心概念

  • 有2个模式
  • 复杂模式:可以有更强的功能但是更难
  • 极简模式:新手能轻松上手不需要看复杂的文档

游戏对象

"player" 玩家 "NPC" 游戏NPC “block”方块,一个基本单位,不一定是正方形 "PNG" PNG 的贴图

帮助文档

创建窗口

PyToolsgr.OS(OS) # Windows , MacOS , Linux

game = PyToolsgr.game(分辨率数组,是否全屏,窗口标题,是否可以调整窗口大小,最大帧率,是否显示帧率,是否开启物理引擎,2d或3d)

示例代码:

from PyToolsgr import *
PyToolsgr.OS('Windows') # 或MacOS , Linux

x = (1080,720) # 窗口大小
all = True # 是否全屏
title = 'PyToolsgr' # 窗口标题
y = True # 是否可以调整窗口大小
fps = 60 # 最大帧率
fpsx = True # 是否显示帧率
phy = True # 是否开启物理引擎
mode = '2d' # 2d或3d

game = PyToolsgr.game(x,all,title,y,fps,fpsx,phy,mode)  

game.run()

许可证

cfk 使用 MIT 许可证,详情请查看 LICENSE 文件。

鸣谢

联系方式

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytoolsgr-0.0.1.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pytoolsgr-0.0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file pytoolsgr-0.0.1.tar.gz.

File metadata

  • Download URL: pytoolsgr-0.0.1.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for pytoolsgr-0.0.1.tar.gz
Algorithm Hash digest
SHA256 1492161a68b63ceec63608fa839c50e5a9de3a2c634de4d70161bafbd1225574
MD5 54f7ab204623e472acaeb03f4355c16d
BLAKE2b-256 2e45d4c62bc67e1fbece3cd90092ad22db88fa9213930a1a5d6f56b60c986189

See more details on using hashes here.

File details

Details for the file pytoolsgr-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: pytoolsgr-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for pytoolsgr-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67d7e55ee06deb78ff9df34d55c4b96c8aa701b4a5a9b586634ae13f1550afc6
MD5 456d19afa4654777604bde6c93b61f74
BLAKE2b-256 bb851b4251f9c9155656c33a2c5058b692626a867343619664f61d66c8601938

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page