Adding Images and Moving Objects with Corona SDK

This post is a tie in to the YouTube Video – Adding Images and Moving Objects with Corona SDK.

In this short game development tutorial with Corona SDK, learn how to add an image to your game and how to move an image. We’ll be using two functions display.newImageRect for adding images and transition.to for moving objects.

You can download player.png by clicking the following link – download player.png. This graphic is provided by Kenney.

First, you will need to add an image to the game by entering the following code:

local myPlayer = display.newImageRect("player.png", 66, 92)
myPlayer.x = 100
myPlayer.y = 125

To move an object within your game, use the following code:

transition.to(myPlayer, {x=250, y=250, time=12000})

And that’s it for adding images and moving objects using Corona SDK! Thanks for watching!

Daniel Williams

Leave a Reply

Your email address will not be published. Required fields are marked *