-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
44 lines (35 loc) · 1.32 KB
/
main.lua
File metadata and controls
44 lines (35 loc) · 1.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
-- SETUP ---------------------------------------------------------------------------------------------------------------
display.setDefault("background", 1)
------------------------------------------------------------------------------------------------------------------------
-- RUN GAME --
------------------------------------------------------------------------------------------------------------------------
require("LiveEdit")
local circle = display.newCircle(100, 100, 10)
circle:setFillColor(1, 0, 0)
transition.loop(circle, {
time = 1000,
x = 200,
iterations = 0,
transition = easing.inOutSine,
})
local text = display.newText({
text =
[[Shift scroll over the target you want to select and move it around.
You can also edit it in the edit.lua file.
Live edit the moving purple circle in the liveEdit function in main.lua]],
x = display.contentCenterX,
y = 50,
fontSize = 14,
align = "center",
font = native.systemFont,
})
text:setFillColor(0)
for i = 1, 10 do
local circle = display.newCircle(math.random(100, 300), math.random(100, 300), 10)
circle:setFillColor(0, 1, 0)
end
liveEdit(function()
-- save this file to see the changes
circle.y = math.random(100, 300)
circle:setFillColor(math.random(), math.random(), math.random())
end)