Corona Resource Centre - Tutorials, Templates And More...

Hi again everyone. It’s been a few weeks so i thought i’d get around to adding a few helpful topics to the list.

The two links that are the most beneficial are “Stackbuster” and “Simple Bubble Popper”. Stackbuster is a great game example and will be very helpful to anyone who’s attempting to make a Jawbreaker or Same Game style game. Simple bubble popper is a great intro to object orientated programming and full of handy code snippets and i highly recommend everyone to check it out :slight_smile:

 

The 5 Most Recently Added Links - Last updated: 13/03/2013

 

Stackbuster: A Jawbreaker Clone - By BeyondtheTech

Performance Optimizations

Runtime Error Handling

New Widgets: Part 3

Simple Bubble Popper - An Intro to Object Orientated Programming

 

 

 

If i’ve missed any recent tutorials then just let me know and i’ll add them to the list. :slight_smile:

Thanks!

Hey!

I’ve been slacking slightly, but i’ve finally got around to updating the resource section! Its now up to a particularly large 485 links!

As well as the five below, a whole bunch of other tutorials and templates have been added including another 8 tutorials from MobileTuts+!

The 5 Most Recently Added Links - Last updated: 20/04/2013

Calendar Sample

Creating a Clock with Corona SDK

Tutorial: Lua String Magic

Physics: Radial Gravity and Predicting Trajectory

Cleaning Up Display Objects and Listeners

Hey!

I’ve been slacking slightly, but i’ve finally got around to updating the resource section! Its now up to a particularly large 485 links!

As well as the five below, a whole bunch of other tutorials and templates have been added including another 8 tutorials from MobileTuts+!

The 5 Most Recently Added Links - Last updated: 20/04/2013

Calendar Sample

Creating a Clock with Corona SDK

Tutorial: Lua String Magic

Physics: Radial Gravity and Predicting Trajectory

Cleaning Up Display Objects and Listeners

Seeing the mention of the bit plugin in the most recent public release, a link or two may be handy.

This is quite a good list, especially the two “resources” parts, and looks to be an interesting page in its own right (only just discovered it myself):

http://chessprogramming.wikispaces.com/Bit-Twiddling

In particular, http://graphics.stanford.edu/~seander/bithacks.html and http://www.hackersdelight.org/basics1.pdf are great starting points and seem to complement one another well.

Bob Jenkins has a lot of material too, though one might have to sift a bit: http://burtleburtle.net/bob/hash/

I have some (useful?) Lua examples of my own:

https://github.com/ggcrunchy/LittleGreenMen/blob/master/utils.lua Not Corona (rather, LuaJIT + ANGLE), but a couple functions should be portable. CLP2 (ceiling log power of 2) might be useful to some… it rounds up to the next power of 2. Although not exactly well-documented otherwise, the 3-value Morton numbers have comments next to them showing how the bits get spread out during the interleave, showing where the “magic” numbers originate.

https://github.com/ggcrunchy/LittleGreenMen/blob/master/ray_slopes.lua Another one from the same project (unfortunately not as portable) with comments explaining (probably not well…) how a bunch of tests got converted into bitmasks / lookup tables.

I don’t know that there’s any reasonable way to incorporate them. But those ideas / methods are good to know… maybe future tutorial material?

https://github.com/ggcrunchy/corona-sdk-snippets/blob/master/bitwise_ops.lua A few Corona utilities (this one actually has some improvements coming, once I bring them in from another project) built on bitwise ops, including stuff from the above-mentioned Bit Twiddling Hacks and Hacker’s Delight.

Here and elsewhere in the SDK snippets project, I kludged my way around not having bit ops (if curious, search for files that do

local has\_bit, bit = pcall(require, "bit") -- Prefer BitOp

up front; some of those cases ought to be more elegant now that there’s support), but maybe some ideas can be gleaned anyhow.

Great thanks StarCrunch, i’ll go through them later and see what there like :slight_smile:

In regards to the new plugins, i’d like to add a new plugin section to the tutorial section with helpful links but i haven’t quite gotten around to it yet.

Also to anyone that is interested i’ve got a fair few other tutorials to add from the last few weeks, i’ve been slacking somewhat with adding them, but they will be live in a day or two :slight_smile:

Ok the resource list has been updated :smiley: Around 20 or so links were added this time, including a variety on BitOps, CoronaCloud and some other game tutorials. As so many were added this time, the recently added list below has been changed to include a variety of the latest!

The 5 Most Recently Added Links - Last updated: 05/06/2013

TEMPLATE: Snake

Lua BitOp: API Functions List

Tutorial: Using the Zip Plugin

How To Make a Breakout Game with Corona

CoronaCloud: Multiplayer Gaming

Wow! I just installed 2013.1135 daily build with the BitOp plugin. I have been doing AES encoding/decoding for my game data and it was quite slow (taking between 529-563ms to encode new score/name/gold data). This was using the bit.lua code for bit twiddling.

With the new BitOp plugin, the AES coding takes 3-4ms…!!! It really blew me away!

Well, for others wanting to use in-program AES encoing/decoding for their data, you can look here:

https://github.com/bighil/aeslua

http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

It is really simple to integrate with Corona. I use a simple byte to hex encoder to send the AES encoded result over the web (or you can use JSON and alike). My byte to hex and reverse routines for your convenience:

local inpnum,inpbin function tohex(inpbin) local cnthex local strhex="" local strlen=string.len(inpbin) for cnthex=1, strlen do strhex=strhex..string.sub(string.format("0%X",string.byte(inpbin,cnthex)),-2,-1) end return strhex end function fromhex(inpbin) local cnthex local strnum local subbin local strlen=string.len(inpbin)/2 local outbin="" for cnthex=1, strlen do subbin=inpbin:sub((cnthex\*2)-1,(cnthex\*2)) strnum=tonumber(subbin,16) outbin=outbin..string.char(strnum) end return outbin end

Happy coding!

Thanks for sharing Renato, it’s good to know the BitOp plugin is working well!

Seeing the mention of the bit plugin in the most recent public release, a link or two may be handy.

This is quite a good list, especially the two “resources” parts, and looks to be an interesting page in its own right (only just discovered it myself):

http://chessprogramming.wikispaces.com/Bit-Twiddling

In particular, http://graphics.stanford.edu/~seander/bithacks.html and http://www.hackersdelight.org/basics1.pdf are great starting points and seem to complement one another well.

Bob Jenkins has a lot of material too, though one might have to sift a bit: http://burtleburtle.net/bob/hash/

I have some (useful?) Lua examples of my own:

https://github.com/ggcrunchy/LittleGreenMen/blob/master/utils.lua Not Corona (rather, LuaJIT + ANGLE), but a couple functions should be portable. CLP2 (ceiling log power of 2) might be useful to some… it rounds up to the next power of 2. Although not exactly well-documented otherwise, the 3-value Morton numbers have comments next to them showing how the bits get spread out during the interleave, showing where the “magic” numbers originate.

https://github.com/ggcrunchy/LittleGreenMen/blob/master/ray_slopes.lua Another one from the same project (unfortunately not as portable) with comments explaining (probably not well…) how a bunch of tests got converted into bitmasks / lookup tables.

I don’t know that there’s any reasonable way to incorporate them. But those ideas / methods are good to know… maybe future tutorial material?

https://github.com/ggcrunchy/corona-sdk-snippets/blob/master/bitwise_ops.lua A few Corona utilities (this one actually has some improvements coming, once I bring them in from another project) built on bitwise ops, including stuff from the above-mentioned Bit Twiddling Hacks and Hacker’s Delight.

Here and elsewhere in the SDK snippets project, I kludged my way around not having bit ops (if curious, search for files that do

local has\_bit, bit = pcall(require, "bit") -- Prefer BitOp

up front; some of those cases ought to be more elegant now that there’s support), but maybe some ideas can be gleaned anyhow.

Great thanks StarCrunch, i’ll go through them later and see what there like :slight_smile:

In regards to the new plugins, i’d like to add a new plugin section to the tutorial section with helpful links but i haven’t quite gotten around to it yet.

Also to anyone that is interested i’ve got a fair few other tutorials to add from the last few weeks, i’ve been slacking somewhat with adding them, but they will be live in a day or two :slight_smile:

Ok the resource list has been updated :smiley: Around 20 or so links were added this time, including a variety on BitOps, CoronaCloud and some other game tutorials. As so many were added this time, the recently added list below has been changed to include a variety of the latest!

The 5 Most Recently Added Links - Last updated: 05/06/2013

TEMPLATE: Snake

Lua BitOp: API Functions List

Tutorial: Using the Zip Plugin

How To Make a Breakout Game with Corona

CoronaCloud: Multiplayer Gaming

Wow! I just installed 2013.1135 daily build with the BitOp plugin. I have been doing AES encoding/decoding for my game data and it was quite slow (taking between 529-563ms to encode new score/name/gold data). This was using the bit.lua code for bit twiddling.

With the new BitOp plugin, the AES coding takes 3-4ms…!!! It really blew me away!

Well, for others wanting to use in-program AES encoing/decoding for their data, you can look here:

https://github.com/bighil/aeslua

http://en.wikipedia.org/wiki/Advanced_Encryption_Standard

It is really simple to integrate with Corona. I use a simple byte to hex encoder to send the AES encoded result over the web (or you can use JSON and alike). My byte to hex and reverse routines for your convenience:

local inpnum,inpbin function tohex(inpbin) local cnthex local strhex="" local strlen=string.len(inpbin) for cnthex=1, strlen do strhex=strhex..string.sub(string.format("0%X",string.byte(inpbin,cnthex)),-2,-1) end return strhex end function fromhex(inpbin) local cnthex local strnum local subbin local strlen=string.len(inpbin)/2 local outbin="" for cnthex=1, strlen do subbin=inpbin:sub((cnthex\*2)-1,(cnthex\*2)) strnum=tonumber(subbin,16) outbin=outbin..string.char(strnum) end return outbin end

Happy coding!

Thanks for sharing Renato, it’s good to know the BitOp plugin is working well!

Hey everyone!

A quick update to our Resource Center; the Corona cloud section has been removed, 10 new links have been added and a new first stop link has been included pointing to the great guides on this site!

The 5 Most Recently Added Links - Last updated: 08/08/2013

CoronaLabs Guides - New First Stop Link

CoronaLabs Github

Making a Blackjack Game - Part 1

Making a Blackjack Game - Part 2

Tutorial: Non-Physics Collision Detection

Once again please feel free to suggest new links, or even template ideas that you want to see made :slight_smile:

Thanks,

Jamie Trinder

Just a quick link - it’s not written for Lua, but the code is mostly portable.

http://natureofcode.com/book/

It has some really, really cool stuff in it… I’d highly recommend it, if you have like a “programming in general” section.

  • C

P.S. Credits go to @SegaBoy for digging the book up :slight_smile:

Thanks for the link (and SegaBoy)!

That book looks great, i’ll make a note to add that into the list when we next make some changes! :) 

Just a quick note to let you know I just released a majorly updated version of CBEffects - if you don’t mind, please change the CBEffects links:

You can remove the CBResources one, and update the CBEffects link to go to GitHub: www.github.com/GymbylCoding/CBEffects

  • C

Thanks Caleb, i’ll do that later today!

Ok its all been updated :slight_smile: I also added in an extra 6 links!

The 5 Most Recently Added Links - Last updated: 19/08/2013

The Nature of Code - All round good read, but not Lua based

Library: GGScoreoid

Library: GGStick (virtual thumb-stick)

TEMPLATE: Maths Template FREE

TEMPLATE: Fruit Matcher (Candy Crush Style)

Hey everyone!

A quick update to our Resource Center; the Corona cloud section has been removed, 10 new links have been added and a new first stop link has been included pointing to the great guides on this site!

The 5 Most Recently Added Links - Last updated: 08/08/2013

CoronaLabs Guides - New First Stop Link

CoronaLabs Github

Making a Blackjack Game - Part 1

Making a Blackjack Game - Part 2

Tutorial: Non-Physics Collision Detection

Once again please feel free to suggest new links, or even template ideas that you want to see made :slight_smile:

Thanks,

Jamie Trinder