-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgolf.lua
More file actions
32 lines (24 loc) · 677 Bytes
/
golf.lua
File metadata and controls
32 lines (24 loc) · 677 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
tfm.exec.newGame(4236177)
tfm.exec.setGameTime(8000,true)
golfer = "Dedax"
system.bindMouse(golfer, true)
tfm.exec.addShamanObject(6, 60, 350, 0, 0, false)
inhole = 0
offset = 3.33333333333333333333
holex = 700
holey = 355
function eventLoop(currentTime,timeRemaining)
if inhole == 0 then
ballx = tfm.get.room.objectList[200].x
bally = tfm.get.room.objectList[200].y
if (ballx >= holex-50 and ballx <= holex+50) then
if (bally >= holey-15 and bally <= holey+15) then
ui.addTextArea(1, "you did it!!!", nil, 370, 200, 60, 0, 0x324650, 0x212F36, 0.2, false)
inhole = 1
end
end
end
end
function eventMouse(name,x,y)
tfm.exec.explosion(x, y, 20, 50, false)
end