<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://wiki.playstaxel.com/index.php?action=history&amp;feed=atom&amp;title=Mini-Games</id>
		<title>Mini-Games - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.playstaxel.com/index.php?action=history&amp;feed=atom&amp;title=Mini-Games"/>
		<link rel="alternate" type="text/html" href="https://wiki.playstaxel.com/index.php?title=Mini-Games&amp;action=history"/>
		<updated>2026-05-22T21:22:13Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.25.2</generator>

	<entry>
		<id>https://wiki.playstaxel.com/index.php?title=Mini-Games&amp;diff=7142&amp;oldid=prev</id>
		<title>Callum at 16:04, 3 May 2019</title>
		<link rel="alternate" type="text/html" href="https://wiki.playstaxel.com/index.php?title=Mini-Games&amp;diff=7142&amp;oldid=prev"/>
				<updated>2019-05-03T16:04:05Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 16:04, 3 May 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;L72&quot; &gt;Line 72:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 72:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''translations''' - The resulting translation strings returned as an array. This may be null until ''complete'' is true. This will be in the same order as the translation codes given to ''getTranslations''.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''translations''' - The resulting translation strings returned as an array. This may be null until ''complete'' is true. This will be in the same order as the translation codes given to ''getTranslations''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''complete''' - True if the translations have been loaded. False otherwise.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* '''complete''' - True if the translations have been loaded. False otherwise.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;= Debugging =&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Mini-games can be debugged via a Chrome debugger. Create a file within the same folder as the Staxel.Client.exe executable called &amp;quot;core.config&amp;quot; and fill it with the following to enable ui (and mini-game) debugging:&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;{&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;#160; &amp;quot;ShowConsoleClient&amp;quot;: true&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;}&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/pre&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Optionally, simply create an empty file called &amp;quot;showconsole.txt&amp;quot; within the same folder as the Staxel.Client.exe executable for the same effect.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Once the Staxel Client is running and showing its debug window, open the mini-game menu (by interacting with an Arcade Machine), open a Chrome page, and enter &amp;quot;http://localhost:8086/&amp;quot; into the URL search box.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Callum</name></author>	</entry>

	<entry>
		<id>https://wiki.playstaxel.com/index.php?title=Mini-Games&amp;diff=7140&amp;oldid=prev</id>
		<title>Callum: Created page with &quot;Category:Modding Mini-Games are small, moddable, self-contained javascript games that can be played by interacting with an arcade machine (or specifically, tiles that use...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.playstaxel.com/index.php?title=Mini-Games&amp;diff=7140&amp;oldid=prev"/>
				<updated>2019-05-03T15:50:00Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&lt;a href=&quot;/Category:Modding&quot; title=&quot;Category:Modding&quot;&gt;Category:Modding&lt;/a&gt; Mini-Games are small, moddable, self-contained javascript games that can be played by interacting with an arcade machine (or specifically, tiles that use...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Modding]]&lt;br /&gt;
Mini-Games are small, moddable, self-contained javascript games that can be played by interacting with an arcade machine (or specifically, tiles that use the &amp;quot;staxel.entityAction.PlayGame&amp;quot; interactActionTrigger).&lt;br /&gt;
Programming knowledge is required.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Getting Started =&lt;br /&gt;
All mini-games are referenced through the miniGames.config file located in the root content folder. Each mini-game must have the following:&lt;br /&gt;
* '''code''' - The code used to refer to a particular mini-game.&lt;br /&gt;
* '''gameSource''' - The local path to a .js file containing the source code for the mini-game.&lt;br /&gt;
* '''icon''' - (optional) The local path to a .png image that will be displayed in the mini-game selection list.&lt;br /&gt;
&lt;br /&gt;
To add your own mini-game without modifying miniGames.config (recommended for public mods), first, create a .patch file with contents similar to the following:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
{&lt;br /&gt;
  &amp;quot;file&amp;quot;: &amp;quot;miniGames.config&amp;quot;, // name of the file to &amp;quot;patch&amp;quot;&lt;br /&gt;
  &amp;quot;patch&amp;quot;: {&lt;br /&gt;
    // the miniGamesList from miniGames.config will be merged with our one here&lt;br /&gt;
    &amp;quot;miniGamesList&amp;quot;: [&lt;br /&gt;
      {&lt;br /&gt;
        &amp;quot;code&amp;quot;: &amp;quot;my.mod.code&amp;quot;,&lt;br /&gt;
        &amp;quot;icon&amp;quot;: &amp;quot;mods/myMod/Icon.png&amp;quot;,&lt;br /&gt;
        &amp;quot;gameSource&amp;quot;: &amp;quot;mods/myMod/myMiniGame.js&amp;quot;&lt;br /&gt;
      }&lt;br /&gt;
    ]&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Once the patch file is created the game itself can be added to the source file mentioned in &amp;quot;gameSource&amp;quot; above. In this example, the file should be called &amp;quot;myMiniGame.js&amp;quot; inside the &amp;quot;mods/myMod&amp;quot; folder. Additionally, if an icon was specified, an image should be added as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Mini-Game API =&lt;br /&gt;
=== MiniGameHandler ===&lt;br /&gt;
All API functions are called from an object that must be named MiniGameHandler. &lt;br /&gt;
The following members are initialised automatically and can be used immediately:&lt;br /&gt;
* '''canvas''' - The canvas element used to render to.&lt;br /&gt;
* '''defaultFont''' - The current font name in use by the current language. Defaults to &amp;quot;Arial&amp;quot; if no font is currently in use.&lt;br /&gt;
* '''defaultFontSize''' - The current font size in use by the current language. Defaults to &amp;quot;20pt&amp;quot;.&lt;br /&gt;
* '''playSound(soundCode)''' - Plays a sound specified by ''soundCode (String)''.&lt;br /&gt;
* '''loadImage(imagePath, width, height)''' - Loads an image from disk specified by ''imagePath (String)'', or from the cache if available. ''width'' and ''height'' specify the size of the image. Returns a future Object that can be used to get the resulting image. See [[#ImageFuture]].&lt;br /&gt;
* '''getTranslations(codes)''' - Loads translations from the Staxel Client specified by their codes from ''codes (String Array)''. Returns a future Object that can be used to get the resulting translations. See [[#TranslationsFuture]].&lt;br /&gt;
* '''exit()''' - Call this function if you would like to close the mini-game. Also called automatically if the mini-game needs to be closed externally. Proceeds to call the ''stop()'' function.&lt;br /&gt;
&lt;br /&gt;
The following members must be defined (or may be optional):&lt;br /&gt;
* '''renderingType()''' - Called before the call to ''start()''. Return &amp;quot;pixelated&amp;quot; for pixelated rendering, or an empty string to default rendering.&lt;br /&gt;
* '''start()''' - Called when the game is ready to start. Use this to initialise any required state.&lt;br /&gt;
* '''stop()''' - Called during a call to ''exit()''. Use this function to clean up any resources.&lt;br /&gt;
* '''update()''' - Called when Staxel is ready to render a frame for the mini-game. Gets called as often as possible (approximately 60 times per second). Use this function to update mini-game logic and render to the canvas.&lt;br /&gt;
* '''pause()''' - Called when Staxel gets paused or if the player presses the Back interface key/button (Esc by default on keyboards). Used externally and should not be used to pause a mini-game manually.&lt;br /&gt;
* '''resume()''' - Called when Staxel gets resumed or if the player presses the Continue button in the pause menu. Used externally and should not be used to pause a mini-game manually.&lt;br /&gt;
* '''pressAccept()''' - Optional. Called when the player presses the Accept interface key/button.&lt;br /&gt;
* '''tabPrevious()''' - Optional. Called when the player presses the TabPrevious interface key/button.&lt;br /&gt;
* '''tabNext()''' - Optional. Called when the player presses the TabNext interface key/button.&lt;br /&gt;
* '''pressPrevious()''' - Optional. Called when the player presses the Previous interface key/button.&lt;br /&gt;
* '''pressNext()''' - Optional. Called when the player presses the Next interface key/button.&lt;br /&gt;
* '''pressUp()''' - Optional. Called when the player presses the Up interface key/button.&lt;br /&gt;
* '''pressDown()''' - Optional. Called when the player presses the Down interface key/button.&lt;br /&gt;
* '''pressLeft()''' - Optional. Called when the player presses the Left interface key/button.&lt;br /&gt;
* '''pressRight()''' - Optional. Called when the player presses the Right interface key/button.&lt;br /&gt;
* '''releaseUp()''' - Optional. Called when the player releases the Up interface key/button.&lt;br /&gt;
* '''releaseDown()''' - Optional. Called when the player releases the Down interface key/button.&lt;br /&gt;
* '''releaseLeft()''' - Optional. Called when the player releases the Left interface key/button.&lt;br /&gt;
* '''releaseRight()''' - Optional. Called when the player releases the Right interface key/button.&lt;br /&gt;
&lt;br /&gt;
=== ImageFuture ===&lt;br /&gt;
An ImageFuture is an Object with two members:&lt;br /&gt;
* '''element''' - The resulting image element loaded. This may be null until ''complete'' is true.&lt;br /&gt;
* '''complete''' - True if the image has finished loading. False otherwise.&lt;br /&gt;
&lt;br /&gt;
=== TranslationsFuture ===&lt;br /&gt;
A TranslationsFuture is an Object with two members:&lt;br /&gt;
* '''translations''' - The resulting translation strings returned as an array. This may be null until ''complete'' is true. This will be in the same order as the translation codes given to ''getTranslations''.&lt;br /&gt;
* '''complete''' - True if the translations have been loaded. False otherwise.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
= Example =&lt;br /&gt;
For more examples see the existing mini-games located in &amp;quot;staxel/ui/js/MiniGames&amp;quot;.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
var MiniGameHandler = {};&lt;br /&gt;
var MyGame = {&lt;br /&gt;
  paused: false&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
MiniGameHandler.renderingType = function() {&lt;br /&gt;
    return &amp;quot;pixelated&amp;quot;;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
MiniGameHandler.start = function() {&lt;br /&gt;
    // set any state here&lt;br /&gt;
    MyGame.paused = false;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
MiniGameHandler.stop = function() {&lt;br /&gt;
    // clean up any resources here&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
MiniGameHandler.pause = function() {&lt;br /&gt;
    MyGame.paused = true;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
MiniGameHandler.resume = function() {&lt;br /&gt;
    MyGame.paused = false;&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
MiniGameHandler.pressAccept = function() {&lt;br /&gt;
    // handle Accept press here&lt;br /&gt;
};&lt;br /&gt;
&lt;br /&gt;
MiniGameHandler.update = function() {&lt;br /&gt;
    if (MyGame.paused)&lt;br /&gt;
        return;&lt;br /&gt;
    // handle any update logic here&lt;br /&gt;
&lt;br /&gt;
    // render to the canvas here&lt;br /&gt;
};&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Callum</name></author>	</entry>

	</feed>