O'Reilly logo

Corona SDK HOTSHOT by Nevin Flanagan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Assembling the splatter layers

Now that we have some notion of how to combine the elements, we'll put them together in the actual code. Because we have two different images that we'll want layered together, the splatter object can't be just a single display object any more. We'll replace it with a group, layer on highlights, and add the impression of motion.

Getting ready

Make sure that the effects folder in your project contains the images blood.png, splat.png, and highlight.png. Copy these from the version 1 subfolder of the Predation directory in the project pack if needed.

Getting on with it

Start by opening the file blast.lua and perform the following steps:

  1. Near the beginning of the file, load the mask:
    local category = require "category"
    
    local ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required