Playing with Corona SDK - The Hamburger

April meetup: Playing with Corona SDK
Download Corona SDK
Download the Hamburger graphics

main.lua code:

local physics = require("physics")
physics.start()

local gameUI = require("gameUI")
local dragBody = gameUI.dragBody

local shapedefs =require("shapedefs")
local physicsData = shapedefs.physicsData(1.0)
local background = display.newImage("bkg_clouds.png")

local ground = display.newImage("ground.png")
ground.y = display.contentHeight - ground.height/2;

physics.addBody(ground, "static", {density=1.0, friction=0.3, bounce=0.1})

function newHamburger()
local hamburger = display.newImage("hamburger.png")
hamburger.y = -100
hamburger.x = math.random(320)

physics.addBody(hamburger, "dynamic", physicsData:get("hamburger"))
hamburger:addEventListener("touch", gameUI.dragBody)
end

timer.performWithDelay(500, newHamburger, 100)

Table of Contents

Page title Most recent update Last edited by
Grab Magic @aral June 2, 2012 10:44 AM Karl Erik B.
Playing with Corona SDK - The Hamburger April 29, 2011 8:57 PM Karl Erik B.
About CocoaHeads Oslo December 28, 2010 4:35 PM Karl Erik B.

Our Sponsors

  • Squarehead Technology

    Hosting av Meetup. Mat og drikke.

  • Kodemaker

    Sponsing av meetupkonto. Mat og drikke.

  • Heroku

    Foredragsholdere

  • JetBrains

    Foredragsholdere og rabatt på AppCode

  • 7N

    Har sponset meetupkonto. Og noen ganger mat og drikke.

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy