I just installed Corona Game Edition and tried to create a simple clock using the clock tutorial as found on the web. However, when I launch main.lua in the simulator, it shows… nothing! Just a black screen.
When launching it in the debugger, the iPhone simulator freezes completely. I have to shut it down forcefully. The debugger does not say anything. I assumed that the debugger would say what’s wrong instead of crashing :o
Here’s my code:
[lua]local background = display.newImage(“background.png”)
local hourHand = display.newImage(“hourHand.png”, 152, 185)
local minuteHand = display.newImage(“minuteHand.png”, 152, 158)
local center = display.newImage(“center.png”, 150, 230)
local secondHand = display.newImage(“secondHand.png”, 160, 155)
hourHand:setReferencePoint (display.BottomCenterReferencePoint)
minuteHand:setReferencePoint (display.BottomCenterReferencePoint)
secondHand:setReferencePoint (display.BottomCenterReferencePoint)
local objTime = os.date("*t")
hourHand.rotation = objTime.hour * 30 + (objTime.min * 0.5)
minuteHand.rotation = objTime.min * 6
secondHand.rotation = objTime.sec * 6
objTime = nil
local function moveHands(event)
local objTime = os.date("*t")
hourHand.rotation = objTime.hour * 30 + (obTime.min * 0.5)
minuteHand.rotation = objTime.min * 6
secondHand.rotation = objTime.sec * 6
end
timer.performWithDelay (1000, moveHands, 0)[/lua]
And here’s the debugger output:
Copyright (C) 2009-2010 A n s c a , I n c .
Version: 0.4.0
Build: 2010.9.2.81
The file sandbox for this project is located at the following folder:
(/Users/MikeAccount/Library/Application Support/Corona Simulator/Corona\_Clock-9893B60112736FA2DF6CABC428DFF4B6)
Paused at file main.lua
Type 'help' for commands
\>
Is there something wrong with the code? Once executed, the simulator freezes completely and the debugger does not say anything helpful. [import]uid: 9644 topic_id: 2334 reply_id: 302334[/import]