Commits

Anonymous committed 52594a8

added initial gamestate "requirements" to check minimal requirements

Comments (0)

Files changed (19)

doc/files/classes/actor_background.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/classes/board.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/classes/object.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/classes/sensor.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/conf.html

 	</li>
 
 	<li>
+		<a href="../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/lib/SECS.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/lib/SaveTableToFile.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/lib/gamestate.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/main.html

 	</li>
 
 	<li>
+		<a href="../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/states/game.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/states/gameover.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/states/intro.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/states/menu.html

 	</li>
 
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/states/pause.html

 	<li><strong>states/pause.lua</strong></li>
 	
 	<li>
+		<a href="../../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="../../files/utils.html">utils.lua</a>
 	</li>
 

doc/files/states/requirements.html

+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+    <title>Reference</title>
+    <link rel="stylesheet" href="../../luadoc.css" type="text/css" />
+	<!--meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/-->
+</head>
+
+<body>
+<div id="container">
+
+<div id="product">
+	<div id="product_logo"></div>
+	<div id="product_name"><big><b></b></big></div>
+	<div id="product_description"></div>
+</div> <!-- id="product" -->
+
+<div id="main">
+
+<div id="navigation">
+
+
+<h1>LuaDoc</h1>
+<ul>
+	
+	<li><a href="../../index.html">Index</a></li>
+	
+</ul>
+
+
+<!-- Module list -->
+
+
+
+<!-- File list -->
+
+<h1>Files</h1>
+<ul>
+
+	<li>
+		<a href="../../files/classes/actor_background.html">classes/actor_background.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/classes/board.html">classes/board.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/classes/object.html">classes/object.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/classes/sensor.html">classes/sensor.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/conf.html">conf.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/lib/SECS.html">lib/SECS.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/lib/SaveTableToFile.html">lib/SaveTableToFile.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/lib/gamestate.html">lib/gamestate.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/main.html">main.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/states/game.html">states/game.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/states/gameover.html">states/gameover.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/states/intro.html">states/intro.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/states/menu.html">states/menu.lua</a>
+	</li>
+
+	<li>
+		<a href="../../files/states/pause.html">states/pause.lua</a>
+	</li>
+
+	<li><strong>states/requirements.lua</strong></li>
+	
+	<li>
+		<a href="../../files/utils.html">utils.lua</a>
+	</li>
+
+</ul>
+
+
+
+
+
+
+</div> <!-- id="navigation" -->
+
+<div id="content">
+
+<h1>File <code>states/requirements.lua</code></h1>
+
+
+
+
+
+
+
+<h2>Functions</h2>
+<table class="function_list">
+
+	<tr>
+	<td class="name" nowrap><a href="#Gamestate.requirements:draw">Gamestate.requirements:draw</a>&nbsp;(draw)</td>
+	<td class="summary">state (LUADOC TODO add resume) state (LUADOC TODO add description) </td>
+	</tr>
+
+	<tr>
+	<td class="name" nowrap><a href="#Gamestate.requirements:enter">Gamestate.requirements:enter</a>&nbsp;(pre, enter)</td>
+	<td class="summary">state (LUADOC TODO add resume) state (LUADOC TODO add description) </td>
+	</tr>
+
+	<tr>
+	<td class="name" nowrap><a href="#Gamestate.requirements:leave">Gamestate.requirements:leave</a>&nbsp;(leave)</td>
+	<td class="summary">state (LUADOC TODO add resume) state (LUADOC TODO add description) </td>
+	</tr>
+
+	<tr>
+	<td class="name" nowrap><a href="#Gamestate.requirements:update">Gamestate.requirements:update</a>&nbsp;(dt, update)</td>
+	<td class="summary">state (LUADOC TODO add resume) state (LUADOC TODO add description) </td>
+	</tr>
+
+</table>
+
+
+
+
+
+
+<br/>
+<br/>
+
+
+
+
+<h2><a name="functions"></a>Functions</h2>
+<dl class="function">
+
+
+
+<dt><a name="Gamestate.requirements:draw"></a><strong>Gamestate.requirements:draw</strong>&nbsp;(draw)</dt>
+<dd>
+state (LUADOC TODO add resume) state (LUADOC TODO add description)
+
+
+<h3>Parameters:</h3>
+<ul>
+	
+	<li>
+	  <code><em>draw</em></code>: (LUADOC TODO add draw description)
+	</li>
+	
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>(LUADOC TODO add return description)</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="Gamestate.requirements:enter"></a><strong>Gamestate.requirements:enter</strong>&nbsp;(pre, enter)</dt>
+<dd>
+state (LUADOC TODO add resume) state (LUADOC TODO add description)
+
+
+<h3>Parameters:</h3>
+<ul>
+	
+	<li>
+	  <code><em>pre</em></code>: (LUADOC TODO add pre description)
+	</li>
+	
+	<li>
+	  <code><em>enter</em></code>: (LUADOC TODO add enter description)
+	</li>
+	
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>(LUADOC TODO add return description)</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="Gamestate.requirements:leave"></a><strong>Gamestate.requirements:leave</strong>&nbsp;(leave)</dt>
+<dd>
+state (LUADOC TODO add resume) state (LUADOC TODO add description)
+
+
+<h3>Parameters:</h3>
+<ul>
+	
+	<li>
+	  <code><em>leave</em></code>: (LUADOC TODO add leave description)
+	</li>
+	
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>(LUADOC TODO add return description)</ul>
+
+
+
+</dd>
+
+
+
+
+<dt><a name="Gamestate.requirements:update"></a><strong>Gamestate.requirements:update</strong>&nbsp;(dt, update)</dt>
+<dd>
+state (LUADOC TODO add resume) state (LUADOC TODO add description)
+
+
+<h3>Parameters:</h3>
+<ul>
+	
+	<li>
+	  <code><em>dt</em></code>: (LUADOC TODO add dt description)
+	</li>
+	
+	<li>
+	  <code><em>update</em></code>: (LUADOC TODO add update description)
+	</li>
+	
+</ul>
+
+
+
+
+
+
+<h3>Return value:</h3>
+<ul>(LUADOC TODO add return description)</ul>
+
+
+
+</dd>
+
+
+</dl>
+
+
+
+
+
+
+
+</div> <!-- id="content" -->
+
+</div> <!-- id="main" -->
+
+<div id="about">
+	<p><a href="http://validator.w3.org/check?uri=referer"><img src="http://www.w3.org/Icons/valid-xhtml10" alt="Valid XHTML 1.0!" height="31" width="88" /></a></p>
+</div> <!-- id="about" -->
+
+</div> <!-- id="container" -->	
+</body>
+</html>

doc/files/utils.html

 		<a href="../files/states/pause.html">states/pause.lua</a>
 	</li>
 
+	<li>
+		<a href="../files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
 	<li><strong>utils.lua</strong></li>
 	
 </ul>
 	</li>
 
 	<li>
+		<a href="files/states/requirements.html">states/requirements.lua</a>
+	</li>
+
+	<li>
 		<a href="files/utils.html">utils.lua</a>
 	</li>
 
 	</tr>
 
 	<tr>
+		<td class="name"><a href="files/states/requirements.html">states/requirements.lua</a></td>
+		<td class="summary"></td>
+	</tr>
+
+	<tr>
 		<td class="name"><a href="files/utils.html">utils.lua</a></td>
 		<td class="summary"></td>
 	</tr>
 require("utils")
 
 --states requires
+require("states/requirements")
 require("states/intro")
 require("states/menu")
 require("states/game")
   fontCacheInit(nil,nil,10,16,20)
 
   Gamestate.registerEvents()
-  Gamestate.switch(Gamestate[(arg[2] and arg[2]:match("--state=(.+)") or "intro")])
+  Gamestate.switch(Gamestate[(arg[2] and arg[2]:match("--state=(.+)") or "requirements")])
 end

states/requirements.lua

+--- requirements gamestate
+Gamestate.requirements = Gamestate.new()
+
+-- constant
+
+-- state variables
+Gamestate.requirements.font = false
+Gamestate.requirements.errors = ""
+
+
+function Gamestate.requirements:check_requirements()
+	self.errors = ""
+	return true
+end
+
+--- state (LUADOC TODO add resume)
+-- state (LUADOC TODO add description)
+-- @param enter (LUADOC TODO add enter description) 
+-- @param pre (LUADOC TODO add pre description) 
+-- @return (LUADOC TODO add return description) 
+function Gamestate.requirements:enter(pre)
+  if not self.font then self.font = fontCache(nil,20) end
+  love.graphics.setBackgroundColor(0, 0, 0)
+end
+
+--- state (LUADOC TODO add resume)
+-- state (LUADOC TODO add description)
+-- @param leave (LUADOC TODO add leave description) 
+-- @return (LUADOC TODO add return description) 
+function Gamestate.requirements:leave()
+end
+
+--- state (LUADOC TODO add resume)
+-- state (LUADOC TODO add description)
+-- @param update (LUADOC TODO add update description) 
+-- @param dt (LUADOC TODO add dt description) 
+-- @return (LUADOC TODO add return description) 
+function Gamestate.requirements:update(dt)
+  if self:check_requirements() then
+    Gamestate.switch(Gamestate.intro)
+  end
+end
+
+--- state (LUADOC TODO add resume)
+-- state (LUADOC TODO add description)
+-- @param draw (LUADOC TODO add draw description) 
+-- @return (LUADOC TODO add return description) 
+function Gamestate.requirements:draw()
+  love.graphics.setColor(255, 255, 255, 255)
+  love.graphics.setFont(self.font)
+  love.graphics.print("Astertris", 20, 60, -0.3)
+  love.graphics.printf(self.errors, 100, 300, 600, 'center')
+end