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

“ArcadeBoard”的版本间的差异

来自Minecraft插件百科
跳转至: 导航搜索
游戏
介绍
(未显示同一用户的2个中间版本)
第28行: 第28行:
 
提醒: 这个版本的API仍在构建中,以下为文档
 
提醒: 这个版本的API仍在构建中,以下为文档
  
介绍
+
==介绍==
 
ArcadeBoard API的运行方式和其他的游戏API相似。如果你曾经创建过游戏你很可能在这个API中找到对应的设计模式。
 
ArcadeBoard API的运行方式和其他的游戏API相似。如果你曾经创建过游戏你很可能在这个API中找到对应的设计模式。
  
第40行: 第40行:
  
  
了解主要观念
+
==了解主要观念==
  
 
你需要了解API的三大方面.
 
你需要了解API的三大方面.
  
1.游戏玩家
+
===1.游戏玩家===
  
 
加入游戏的玩家称为'GamePlayer'。联机游戏可以让多名玩家同时进行游戏
 
加入游戏的玩家称为'GamePlayer'。联机游戏可以让多名玩家同时进行游戏
  
2.画布
+
===2.画布===
  
 
画布为玩家游玩的区域。每名玩家拥有各自的画布,但是你可以设置全局画布来让所有玩家看到同一件事。(等于计分版)
 
画布为玩家游玩的区域。每名玩家拥有各自的画布,但是你可以设置全局画布来让所有玩家看到同一件事。(等于计分版)
第54行: 第54行:
 
你可以在画布里绘制每一个框架。画布不会在每次更新时重置,你必须重置一部分或是不更新画布(在没有更改的情况下).
 
你可以在画布里绘制每一个框架。画布不会在每次更新时重置,你必须重置一部分或是不更新画布(在没有更改的情况下).
  
3.游戏
+
===3.游戏===
  
 
游戏为你创建新游戏使拓展的class. 游戏拥有的每一帧都会fired game loop . 默认帧数为20, 但是你可以增加到 30FPS.
 
游戏为你创建新游戏使拓展的class. 游戏拥有的每一帧都会fired game loop . 默认帧数为20, 但是你可以增加到 30FPS.
第61行: 第61行:
 
作为开发者你必须计算变更后会发送什么。如果你想要每秒都进行变更,但你只有25FPS,你只需要每25帧触发一次。
 
作为开发者你必须计算变更后会发送什么。如果你想要每秒都进行变更,但你只有25FPS,你只需要每25帧触发一次。
  
了解术语
+
==了解术语==
 
这些术语你必须在创建游戏时铭记于心。
 
这些术语你必须在创建游戏时铭记于心。
  
帧数延迟
+
===帧数延迟===
  
 
在Minecraft低于1.13的版本中拥有帧数延迟。也就是说当你更改一些东西,在3帧内不会显示出来。通常这不是个大问题,25帧只有120毫秒 - 然而你需要在使用inputs时记住一些东西。
 
在Minecraft低于1.13的版本中拥有帧数延迟。也就是说当你更改一些东西,在3帧内不会显示出来。通常这不是个大问题,25帧只有120毫秒 - 然而你需要在使用inputs时记住一些东西。
  
屏幕维度
+
===屏幕维度===
  
 
屏幕维度取决于很多东西. 你可以使用最多15行+1个标题。宽度则为变量:
 
屏幕维度取决于很多东西. 你可以使用最多15行+1个标题。宽度则为变量:
第80行: 第80行:
 
音乐则有所不同,你可以播放NBS文件。
 
音乐则有所不同,你可以播放NBS文件。
  
资源包
+
==资源包==
  
 
API提供了导入PNG文件的能力。你可以创建sprites和tiles.
 
API提供了导入PNG文件的能力。你可以创建sprites和tiles.
第86行: 第86行:
 
你也可以使用自定义字体、音效和音乐。
 
你也可以使用自定义字体、音效和音乐。
  
了解API的拓展性
+
==了解API的拓展性==
 
API易于拓展。这个API包括了绘制屏幕所需的类和工具、创建音乐,还有更多的可能。同时API也提供了一些基础的2D游戏矢量计算、绘制objects或 sprites 的功能- 你甚至可以使用自创的游戏引擎.
 
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.
+
你可以在画布上自由进行绘制. 取决于游戏设置,每名玩家可以拥有独立的画布或是共享同一个画布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.
 
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.
+
像素分辨率在游戏建造者中已被设置. 每个游戏中的'默认'画布拥有分辨率.你必须在每个像素内使用全宽度并在UTF-8编码条件下使用.每个字符都可以拥有颜色.
  
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).
+
X 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).
  
 
=== 标题 ===
 
=== 标题 ===
第181行: 第181行:
 
==资源包==
 
==资源包==
 
==更新日志==
 
==更新日志==
 +
 
=指令=
 
=指令=
 
=配置=
 
=配置=

2019年7月15日 (一) 12:20的版本

欢迎来到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 的功能- 你甚至可以使用自创的游戏引擎.

画布

介绍

你可以在画布上自由进行绘制. 取决于游戏设置,每名玩家可以拥有独立的画布或是共享同一个画布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.

分辨率

像素分辨率在游戏建造者中已被设置. 每个游戏中的'默认'画布拥有分辨率.你必须在每个像素内使用全宽度并在UTF-8编码条件下使用.每个字符都可以拥有颜色.

X 和 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.

游戏

游戏需求

  • The game author must have tested the game for scoreboard usage
  • The game should somehow tell the player on how to use the game (instructions)
  • The game should provide a menu to pause or stop the game (helper methods provided in ArcadeBoard API)

拓展游戏class

The first step is to extend the game class. This will force you to implement a constructor and implement the "game loop" and game events (start/stop).
Each game requires a type parameter to define the Canvas you are drawing on. While the API is Scoreboard centered, it can be scaled for future expansion.

Annotating your extended class

The next step is to provide some information for your game. This is done by annotations that are read by the plugin when the game is loaded into memory.
The required information:

  • GameName (be.maximvdw.arcadeboard.api.annotations.GameName) A name for your game following the requirements of [aA-zZ] (only letters)
  • GameAuthor (be.maximvdw.arcadeboard.api.annotations.GameAuthor)
  • GameVersion (be.maximvdw.arcadeboard.api.annotations.GameVersion)
  • GameDescription (be.maximvdw.arcadeboard.api.annotations.GameDescription)The optional information:
  • GameDisplayName (be.maximvdw.arcadeboard.api.annoations.GameDisplayName) A fancier name than the GameName (can contain numbers and spaces, ..)
  • GameControls (be.maximvdw.arcadeboard.api.annotations.GameControls) Description of your controls
  • GameScreenshots (be.maximvdw.arcadeboard.api.annotations.GameScreenshots) A string array of links to screenshots of your game
  • GamePermalink (be.maximvdw.arcadeboard.api.annotations.GamePermalink) A link to an information page of your game
  • GameVideos (be.maximvdw.arcadeboard.api.annotations.GameVideos) A string array of links to videos of your game
  • GameConstraint (be.maximvdw.arcadeboard.api.annotations.GameConstraint) A constraint given to your game. The game will not start when this constraint is not met. Examples would be a server version, ArcadeBoard version (when you use new features), ...
  • GameConstraints (be.maximvdw.arcadeboard.api.annotations.GameConstraints) A list of multiple constraints

更改游戏设置

The game has some default settings. However you will most likely want to change these. Settings range from things like the minimum amount of players to things like aimed FPS and resource pack requirements.

游戏事件

A class extending a Game will have to implement all the game events. External plugins can just use the Bukkit events to catch these events.

开始游戏

  • When a player wants to start a single player game, the Game is constructed and directly afterwards theGameStartEvent (onGameStart method) is fired.
  • When a player wants to start a multi player game, the Game is constructed but the players are put in a lobby (GameLobby). When the game starts (by reaching a minimum amount of players or when all players are ready) theGameStartEvent (onGameStart method) is fired.

停止游戏

  • A game is stopped when there aren't enough players. The GameEndEvent (onGameEnd method) is fired.
  • A game is stopped when the "stop()" method is called. The GameEndEvent (onGameEnd method) is fired.

玩家离开

  • The GamePlayerLeaveEvent (onPlayerLeave method) is fired when a player leaves. This event is triggered before the GameEndEvent in case the player causes to trigger the minimum amount of players

游戏循环

Once you have the game settings ready, it is time to program inside the game loop. Continue on this wiki for information on how to draw on the Canvas of a player.

游戏教程

游戏玩家

输入事件

菜单

音乐

资源包

更新日志

指令

配置

官方游戏

权限

前置

解疑