• 欢迎来到Minecraft插件百科!
  • 对百科编辑一脸懵逼?帮助:快速入门带您快速熟悉百科编辑!
  • 因近日遭受攻击,百科现已限制编辑,有意编辑请加入插件百科企鹅群:223812289

“ArcadeBoard”的版本间的差异

来自Minecraft插件百科
跳转至: 导航搜索
(创建页面,内容为“<!--HEAD--> <div style="float:none;-webkit-border-image: none;color: #333;height: auto;margin: 0 0 35px 0;min-height: 20px;background-color: #f8f8f8;box-shadow:0…”)
 
画布
第90行: 第90行:
  
 
==画布==
 
==画布==
 +
=== 介绍 ===
 +
The canvas is something you can draw on. Depending on the game settings, each player can have their own individual canvas or one canvas that is shared to all players playing that same game instance.
 +
 +
In the API, you will find that the '''Canvas''' class is abstract and extended by '''CharacterCanvas'''. This is done to allow for future canvasses such as maps, holograms or other interfaces you can display your game on. For now, only character based canvases for scoreboards are supported.
 +
 +
=== Resolution ===
 +
The pixel resolution is defined in your constructor of the Game. Each 'default' canvas in the game has that resolution. You have to use full width UTF-8 characters in each pixel. Each character can (but not has) have a color.
 +
 +
The X and Y origin are located in the top left of the screen. Meaning that the more you go right the Y value will increase, the more you go down the more the X value will increase. It is indexed as an array where 0,0 is the start position and the maximum value is (width-1),(height-1).
 +
 +
=== 标题 ===
 +
You can set the title with the '''setTitle''' setter. The title will be formatted internally with colors and updated alongside the pixel updates.
 +
 +
The maximum length of the title is 32 characters.
 +
 +
=== 绘制 ===
 +
The canvas already has several methods included for drawing. Multiple overloaded methods exist with default values for arguments (such as pixel character).
 +
 +
==== 绘制像素 ====
 +
Allows you to draw a pixel at a specific X,Y position.
 +
 +
==== 画线 ====
 +
Allows you to draw a line between two points.
 +
 +
==== drawRectangle ====
 +
Allows you to draw a rectangle border starting at a specific X,Y position with a given width and height.
 +
 +
==== fillRectangle ====
 +
Allows you to draw a filled rectangle starting at a specific X,Y position with a given width and height.
 +
 +
==== writeString ====
 +
Draws a string with regular ASCII characters at a given X,Y position. In order to compensate for the non-monospace font in minecraft all the pixels left to the X,Y position will be cleared.
 +
 +
The string you provide has to be color formatted if you use color characters.
 +
 
==游戏==
 
==游戏==
 
==游戏教程==
 
==游戏教程==

2019年7月13日 (六) 19:25的版本

欢迎来到ArcadeBoarde插件百科

插件名
ArcadeBoard

作者
Maximvdw

兼容版本
1.8-1.14

原文
[1]

API

ArcadeBoard API


提醒: 这个版本的API仍在构建中,以下为文档

介绍 ArcadeBoard API的运行方式和其他的游戏API相似。如果你曾经创建过游戏你很可能在这个API中找到对应的设计模式。

游戏位于'games'文件夹内并分在独立的JAR文件内。插件会在开服时加载这些游戏。

当然图像是有限的,然而这个API提供了大量的工具来帮助你拓展图像。这个API最主要的游戏类型名为'Tile based games'。如果你不熟悉这个观念,我推荐你阅读这个: https://en.wikipedia.org/wiki/Tile-based_video_game

总而言之: 你创建的游戏利用了低分辨率光栅。 然而你在光栅里所绘制的每个像素都可以通过资源包来实现高清化。 资源包拓展了API的功能,资源包的详细解释请往下看。

Github: https://github.com/Maximvdw/ArcadeBoard-API


了解主要观念

你需要了解API的三大方面.

1.游戏玩家

加入游戏的玩家称为'GamePlayer'。联机游戏可以让多名玩家同时进行游戏

2.画布

画布为玩家游玩的区域。每名玩家拥有各自的画布,但是你可以设置全局画布来让所有玩家看到同一件事。(等于计分版)

你可以在画布里绘制每一个框架。画布不会在每次更新时重置,你必须重置一部分或是不更新画布(在没有更改的情况下).

3.游戏

游戏为你创建新游戏使拓展的class. 游戏拥有的每一帧都会fired game loop . 默认帧数为20, 但是你可以增加到 30FPS.

在game loop中你可以为所欲为地改变画布。 你可以在画布上随意移动一个对象。 作为开发者你必须计算变更后会发送什么。如果你想要每秒都进行变更,但你只有25FPS,你只需要每25帧触发一次。

了解术语 这些术语你必须在创建游戏时铭记于心。

帧数延迟

在Minecraft低于1.13的版本中拥有帧数延迟。也就是说当你更改一些东西,在3帧内不会显示出来。通常这不是个大问题,25帧只有120毫秒 - 然而你需要在使用inputs时记住一些东西。

屏幕维度

屏幕维度取决于很多东西. 你可以使用最多15行+1个标题。宽度则为变量: 每一个像素可拥有不同的颜色的情况下,在1.8-1.12的服务器宽度为72。 然而在不是所有的像素拥有不同的颜色的情况下使用黑白游戏或资源包可以增加宽度。 1.13以上版本的服务器的宽度就没有限制。 音乐和音效

API可以让你播放音乐和音效。 音效设置和Spigot/Bukkit的相似,你可以选择一个音效并设置音量和音高。你还可以指定资源包中不同的ogg音效文件.

音乐则有所不同,你可以播放NBS文件。

资源包

API提供了导入PNG文件的能力。你可以创建sprites和tiles.

你也可以使用自定义字体、音效和音乐。

了解API的拓展性 API易于拓展。这个API包括了绘制屏幕所需的类和工具、创建音乐,还有更多的可能。同时API也提供了一些基础的2D游戏矢量计算、绘制objects或 sprites 的功能- 你甚至可以使用自创的游戏引擎.

画布

介绍

The canvas is something you can draw on. Depending on the game settings, each player can have their own individual canvas or one canvas that is shared to all players playing that same game instance.

In the API, you will find that the Canvas class is abstract and extended by CharacterCanvas. This is done to allow for future canvasses such as maps, holograms or other interfaces you can display your game on. For now, only character based canvases for scoreboards are supported.

Resolution

The pixel resolution is defined in your constructor of the Game. Each 'default' canvas in the game has that resolution. You have to use full width UTF-8 characters in each pixel. Each character can (but not has) have a color.

The X and Y origin are located in the top left of the screen. Meaning that the more you go right the Y value will increase, the more you go down the more the X value will increase. It is indexed as an array where 0,0 is the start position and the maximum value is (width-1),(height-1).

标题

You can set the title with the setTitle setter. The title will be formatted internally with colors and updated alongside the pixel updates.

The maximum length of the title is 32 characters.

绘制

The canvas already has several methods included for drawing. Multiple overloaded methods exist with default values for arguments (such as pixel character).

绘制像素

Allows you to draw a pixel at a specific X,Y position.

画线

Allows you to draw a line between two points.

drawRectangle

Allows you to draw a rectangle border starting at a specific X,Y position with a given width and height.

fillRectangle

Allows you to draw a filled rectangle starting at a specific X,Y position with a given width and height.

writeString

Draws a string with regular ASCII characters at a given X,Y position. In order to compensate for the non-monospace font in minecraft all the pixels left to the X,Y position will be cleared.

The string you provide has to be color formatted if you use color characters.

游戏

游戏教程

游戏玩家

输入事件

菜单

音乐

资源包

更新日志

指令

配置

官方游戏

权限

前置

解疑