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

Displaying the map contents

Right now, the game scene is dependent on another module that hasn't been created, the world module. This module is needed to create a visible representation of the abstract Map data, from the format created by the sok.load function.

Getting ready

The world module is used on the following line in game.lua:

self.World = require "world" (30, 20, lawnParty, statics, lawnParty, movables)

This tells us that the world module needs to return a function. That function takes two numbers, the number of columns of tiles and rows of tiles that the map object can display at once, and several graphical arguments: an image sheet containing the tiles to use for walls, goals, and empty spaces, a table explaining which to use for each purpose, ...

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