Movement, shoot, scoring and adding things

Ok guys here goes, Im completely new to this whole new coding thing ive created a game already have the back ground the ground the two objects that are going to be in the game for main use and now wanting to know how to make my basket on the top of the screen move left to right??? also my cannon I want to rotate from right to left and left to right and then when touched fire I also want to know how to add an object in the cannon to fire it?? I also want to know how to add a score too so that every time you hit the basket your score goes up. It all may sound frustrating and silly believe me im in the same boat by even writing it by we all have to start some where.

Here is what I’ve don so far



– main.lua


local physics = require( “physics” )

physics.start ()

local sky = display.newImage( “sky.png” )
sky.x = 160
sky.y = 195

local ground = display.newImage( “grass1.png” )
ground.x = 160
ground.y = 525
–physics.addbody(ground.{friction = 0.5})
–ground.Bodytype = “static”
ground.Myname = “ground”
local Basket = display.newImage( “Basket22.jpg” )
Basket.x = 157
Basket.y = 30
local Movespeed = 2

local Cannon = display.newImage( “Cannon113.png” )
Cannon.x = 160
Cannon.y = 465

display.setStatusBar( display.HiddenStatusBar )

Please no hate messages as I’m just learning and this is a dummy game to get me more understanding about the whole process

Thank you

Mark