-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.lua
More file actions
39 lines (31 loc) · 770 Bytes
/
main.lua
File metadata and controls
39 lines (31 loc) · 770 Bytes
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
require 'grille'
require 'grille_view'
display.setStatusBar( display.HiddenStatusBar )
local background = display.newRect( 0, 0, display.contentWidth, display.contentHeight )
background:setFillColor(125, 125, 255)
local grille = Grille.new()
grilleView = GrilleView.new(grille)
function leTempsPasse( event)
grille.leTempsPasse()
grilleView.draw()
end
leTempsPasse()
timer.performWithDelay( 800, leTempsPasse, 0 )
function touche( event )
if event.phase == 'began' then
startX = event.x
else
if event.x == startX then
return
end
if event.x > startX then
sens = 1
else
sens = -1
end
startX = event.x
grille.deplacementLateral(sens)
grilleView.draw()
end
end
Runtime:addEventListener('touch', touche)