<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=Tuto_Gideros_Game_Template1_Part_1_Project_Setup</id>
	<title>Tuto Gideros Game Template1 Part 1 Project Setup - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.gideros.rocks/index.php?action=history&amp;feed=atom&amp;title=Tuto_Gideros_Game_Template1_Part_1_Project_Setup"/>
	<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_Gideros_Game_Template1_Part_1_Project_Setup&amp;action=history"/>
	<updated>2026-11-17T20:55:22Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>https://wiki.gideros.rocks/index.php?title=Tuto_Gideros_Game_Template1_Part_1_Project_Setup&amp;diff=23841&amp;oldid=prev</id>
		<title>MoKaLux: Created page with &quot;__TOC__ == Project setup == Create a project and call it anything you want, eg.: &quot;&#039;&#039;Gideros_Game_Template1&#039;&#039;&quot; for example.  In the project properties (right click your project...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.gideros.rocks/index.php?title=Tuto_Gideros_Game_Template1_Part_1_Project_Setup&amp;diff=23841&amp;oldid=prev"/>
		<updated>2024-10-25T16:06:14Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;__TOC__ == Project setup == Create a project and call it anything you want, eg.: &amp;quot;&amp;#039;&amp;#039;Gideros_Game_Template1&amp;#039;&amp;#039;&amp;quot; for example.  In the project properties (right click your project...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;__TOC__&lt;br /&gt;
== Project setup ==&lt;br /&gt;
Create a project and call it anything you want, eg.: &amp;quot;&amp;#039;&amp;#039;Gideros_Game_Template1&amp;#039;&amp;#039;&amp;quot; for example.&lt;br /&gt;
&lt;br /&gt;
In the project properties (right click your project name), in the &amp;#039;&amp;#039;Graphics&amp;#039;&amp;#039; tab, please enter your settings, eg.:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Scale Mode&amp;#039;&amp;#039;&amp;#039;: Letterbox&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Logical Dimensions&amp;#039;&amp;#039;&amp;#039;: 360 * 640 px&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Orientation&amp;#039;&amp;#039;&amp;#039;: Landscape Left&lt;br /&gt;
&lt;br /&gt;
Feel free to configure the other tabs.&lt;br /&gt;
&lt;br /&gt;
== Plugins ==&lt;br /&gt;
To have the basics of a game I added the following plugins:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;JSON&amp;#039;&amp;#039;&amp;#039;: to save user preferences to disk&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Require&amp;#039;&amp;#039;&amp;#039;: for Mobile support&lt;br /&gt;
&lt;br /&gt;
You can double click the Require plugin and configure it to your liking.&lt;br /&gt;
&lt;br /&gt;
We will add more Classes later on.&lt;br /&gt;
&lt;br /&gt;
== Files and Folders ==&lt;br /&gt;
This is how I would organise my files and folders:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Gideros_Game_Template1&amp;#039;&amp;#039; (&amp;#039;&amp;#039;root&amp;#039;&amp;#039;)&lt;br /&gt;
* &amp;#039;&amp;#039;Plugins&amp;#039;&amp;#039;&lt;br /&gt;
** JSON&lt;br /&gt;
** Require&lt;br /&gt;
* &amp;#039;&amp;#039;Files&amp;#039;&amp;#039;&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;audio&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;folder&amp;#039;&amp;#039;)&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;classes&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;folder&amp;#039;&amp;#039;)&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;fonts&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;folder&amp;#039;&amp;#039;)&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;gfx&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;folder&amp;#039;&amp;#039;)&lt;br /&gt;
** &amp;#039;&amp;#039;&amp;#039;scenes&amp;#039;&amp;#039;&amp;#039; (&amp;#039;&amp;#039;folder&amp;#039;&amp;#039;)&lt;br /&gt;
**init.lua (&amp;#039;&amp;#039;file&amp;#039;&amp;#039;)&lt;br /&gt;
**main.lua (&amp;#039;&amp;#039;file&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Let&amp;#039;s add our first Classes/functions. In the folder &amp;#039;&amp;#039;&amp;#039;classes&amp;#039;&amp;#039;&amp;#039; add these two:&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;[[Media:buttonMonster.lua]]&amp;#039;&amp;#039;&amp;#039; for player control and keyboard navigation &amp;#039;&amp;#039;&amp;#039;(tip: right click and save link as)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* to save data persistently, in the &amp;#039;&amp;#039;classes&amp;#039;&amp;#039; folder, create a file called &amp;quot;&amp;#039;&amp;#039;&amp;#039;save_prefs.lua&amp;#039;&amp;#039;&amp;#039;&amp;quot; and copy the following:&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;lua&amp;quot;&amp;gt;&lt;br /&gt;
require &amp;quot;json&amp;quot;&lt;br /&gt;
&lt;br /&gt;
function saveData(filepath, value)&lt;br /&gt;
	local contents = json.encode(value)&lt;br /&gt;
	local file = io.open(filepath, &amp;quot;w&amp;quot;) -- create file&lt;br /&gt;
	file:write(contents) -- save json string in file&lt;br /&gt;
	io.close(file)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
function getData(filepath)&lt;br /&gt;
	local value&lt;br /&gt;
	local file = io.open(filepath, &amp;quot;r&amp;quot;)&lt;br /&gt;
	if file then&lt;br /&gt;
		local contents = file:read(&amp;quot;*a&amp;quot;) -- read contents&lt;br /&gt;
		value = json.decode(contents) -- decode json&lt;br /&gt;
		io.close(file)&lt;br /&gt;
	end&lt;br /&gt;
	return value&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assets ==&lt;br /&gt;
To build your personalized Game Template you will need some assets like sounds, fonts, ...&lt;br /&gt;
&lt;br /&gt;
In this tutorial I will use my own assets and you will need to replace them with yours in both files and code.&lt;br /&gt;
&lt;br /&gt;
== Next? ==&lt;br /&gt;
That should be enough to get us started. In the next part we will code our &amp;#039;&amp;#039;init.lua&amp;#039;&amp;#039; file.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Next: [[Tuto Gideros Game Template1 Part 2 Init]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Tutorial - Gideros Game Template1]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
{{GIDEROS IMPORTANT LINKS}}&lt;/div&gt;</summary>
		<author><name>MoKaLux</name></author>
	</entry>
</feed>