Game Logic https://code.coronalabs.com/taxonomy/term/12/all en simple_toast https://code.coronalabs.com/code/simpletoast <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Simple example for Toast Notification without any plugins for Corona SDK.</p> <p>For all supported platforms!</p> <p>How to use?</p> <p>• Add toast.lua in your Corona project root directory</p> <p>• Add string 'require "toast"' in main.lua</p> <p>• For display a toast notification, use next code:</p></div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">krdpnsk</div></div></div> Thu, 14 Nov 2019 07:18:03 +0000 krdpnsk 207 at https://code.coronalabs.com Virtual Controller: Multiple Joysticks and Buttons https://code.coronalabs.com/code/virtual-controller-multiple-joysticks-and-buttons <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Simple controller you can use to add multiple joysticks and buttons on screen. Very modifiable.<br /> Very simple to use. There is a sample program that shows using two joysticks and handling their movements with timers and with event handlers that you pass into the controller.<br /></p></div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Trevor</div></div></div> Sat, 01 Apr 2017 01:42:51 +0000 trevornmarshall 205 at https://code.coronalabs.com Simple AI for Corona SDK https://code.coronalabs.com/code/simple-ai-corona-sdk <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><h1>Simple artificial intelligence for Corona SDK</h1> <ul> <li>easy connect to the project</li> <li>light, fast and easy in use</li> <li>flexible</li> <li>extensiable</li> </ul> <h1>Overview</h1></div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">enbahtov</div></div></div> Sat, 02 Jul 2016 04:23:38 +0000 enbahtov 202 at https://code.coronalabs.com Point - A 2D Math Library. Simplifies vector math. https://code.coronalabs.com/code/point-2d-math-library-simplifies-vector-math <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>2d Math Library for Corona SDK / Lua</p> <p>Point is a 2d math library for Corona SDK or just plain ol' lua. It allows us to think of positions within corona as single units (points) vs independent x and y coordinates. You can run methods directly on those points.</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Tameem Hamoui</div></div></div> Wed, 18 May 2016 05:33:43 +0000 tameem50 198 at https://code.coronalabs.com Logicka https://code.coronalabs.com/code/logicka <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>A game that give you a first contact with Programming Logical aspects.</p> <p>Made as a requirement to the PGP discipline at the brazilian university IFSP.</p> <p>Almost all the documentation and code comments are in portuguese.</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Luborges</div></div></div> Wed, 10 Feb 2016 17:52:08 +0000 lucas.s.m.b 195 at https://code.coronalabs.com Virtual Joystick Module with SpriteSheet Example https://code.coronalabs.com/code/virtual-joystick-module-spritesheet-example <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Hello Guys, Send for all, Virtual Joystick module with player sprite working perfect.</p> <p>Sorry for my english, i am brazilian.</p> <p>Thanks for all.</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">William Coelho</div></div></div> Fri, 11 Sep 2015 00:53:32 +0000 williamurucui 187 at https://code.coronalabs.com Fill a Vertical Progress Indicator https://code.coronalabs.com/code/fill-vertical-progress-indicator <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>If you want to place a vertical progress indicator in your code here is how to do it!</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Arthur A. Roberts</div></div></div> Thu, 16 Apr 2015 11:47:33 +0000 aaroberts 175 at https://code.coronalabs.com Infinite Timer Loop https://code.coronalabs.com/code/infinite-timer-loop <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>If you want to animate different objects throughout the game with proper time interval of time, you can use this code. I've used this in my game to animate balloons and other objects in game.<br /> Also this will help to call different functions at different interval of time.</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">akshadaS</div></div></div> Fri, 13 Mar 2015 12:30:40 +0000 akshada.sapre 166 at https://code.coronalabs.com 1 Button with two functions https://code.coronalabs.com/code/1-button-two-functions <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Well, there is a time ago was looking for a function that uses one button with two functions, and saw the people looking for it. I found a possible solution that worked for me. and I will share here.</p> <p>Hello, I am Brazilian and sorry for any errors, my English is bad.<br /> The sample code can be downloaded from the gist attached link.</p></div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Dantes2023</div></div></div> Tue, 17 Feb 2015 01:33:33 +0000 williamurucui 163 at https://code.coronalabs.com Simple Accelerometer Data Conversion to Degrees https://code.coronalabs.com/code/simple-accelerometer-data-conversion-degrees <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Here is a handy lua Corona Labs code chunk to convert xyz accelerometer data to degrees.</p></div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Simon Fearby</div></div></div> Mon, 02 Feb 2015 12:53:19 +0000 FearTec 160 at https://code.coronalabs.com Code from Tutorial: Advanced Random Numbers https://code.coronalabs.com/code/code-tutorial-advanced-random-numbers <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>Code from Tutorial: Advanced Random Numbers (<a href="http://coronalabs.com/blog/2014/03/11/tutorial-advanced-random-numbers/">http://coronalabs.com/blog/2014/03/11/tutorial-advanced-random-numbers/</a>)</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Rob Miracle</div></div></div> Mon, 02 Feb 2015 00:14:16 +0000 Corona Rob 159 at https://code.coronalabs.com Turn Based Gameplay Example https://code.coronalabs.com/code/turn-based-gameplay-example <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>I just started a new project and thought this kind of code may be helpful for people trying to learn.</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Garrett Savo</div></div></div> Fri, 05 Dec 2014 13:35:34 +0000 Garrettsavo 144 at https://code.coronalabs.com Simulate Space in less than 30 lines of Code https://code.coronalabs.com/code/simulate-space-less-30-lines-code <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>it will give you a feeling of a spaceship moving in space</p> <p>another function could show planets and nebulae with different speeds</p> <p>you can also tweak it a little bit and create different transition speeds for stars depending on their sizes</p></div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Tariq</div></div></div> Sun, 26 Oct 2014 06:13:43 +0000 tkhatieb 139 at https://code.coronalabs.com Only Ten to hundred lines of code to make a very small paint game for kids In a smart way https://code.coronalabs.com/code/only-ten-hundred-lines-code-make-very-small-paint-game-kids-smart-way <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>i think the idea is cool</p> <p>just one loop will create small objects (circles or rectangles) to fill the screen<br /> each object will have the same touch event which will fill the object with a randomly selected color</p> <p>add a few lines to have different background color, and different sizes for your objects</p></div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">Tariq</div></div></div> Sun, 26 Oct 2014 05:51:59 +0000 tkhatieb 138 at https://code.coronalabs.com Simple Joystick https://code.coronalabs.com/code/simple-joystick <div class="field field-name-body field-type-text-with-summary field-label-hidden"><div class="field-items"><div class="field-item even" property="content:encoded"><p>A simple Lua/Corona module for an on-screen joystick. Based on code from Rob Miracle (<a href="http://forums.coronalabs.com/topic/32941-virtual-joystick-module-for-games/">http://forums.coronalabs.com/topic/32941-virtual-joystick-module-for-games/</a>), somewhat simplified, removed some nice-ities, but it still works.</p> </div></div></div><div class="field field-name-field-nickname field-type-text field-label-inline clearfix"><div class="field-label">Contributor:&nbsp;</div><div class="field-items"><div class="field-item even">jbp1</div></div></div> Wed, 08 Oct 2014 17:04:49 +0000 jbp1 136 at https://code.coronalabs.com