Notes
Notes - notes.io |
tfm.exec.disableAutoNewGame(true)
tfm.exec.disableAfkDeath(true)
place = 0
function init_matrix(wD, hG)
local result = {}
for y = 0, hG - 1 do
for x = 0, wD - 1 do
result[y * wD + x] = 1
end
result[y * wD + 0] = 0
result[y * wD + wD - 1] = 0
end
for x = 0, wD - 1 do
result[0 * wD + x] = 0
result[(hG - 1) * wD + x] = 0
end
return result
end
function setMap(matrix, wD, hG)
place = 0
xml = '<C><P H="740" Ca="" N="" L="2200" /><Z><S><S P="0,0,0.3,0.2,0,0,0,0" X="1201" L="2500" o="0" H="760" c="4" Y="367" T="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="2200" o="0" H="40" X="1100" N="" Y="0" T="12" /><S P="0,0,0.3,0.2,0,0,0,0" L="2240" o="0" H="40" X="1100" N="" Y="760" T="12" /><S P="0,0,0.3,0.2,90,0,0,0" L="760" o="0" H="40" X="2200" N="" Y="360" T="12" /><S m="" P="0,0,0.3,0.2,90,0,0,0" L="760" o="0" H="40" X="0" N="" Y="360" T="12" />'
xmlEnd = '</S><D><DS Y="40" X="80" /><T X="2082" Y="735" D="" /><F Y="732" X="2080" /></D><O /></Z></C>'
color = string.format("%X", math.random(0x000000, 0xFFFFFF))
invColor = string.format("%06x", 0xffffff - tonumber(color, 16))
for y = 0, hG - 1 do
for x = 0, wD - 1 do
if matrix[y * wD + x] == 0 then
r = ""
else
angle = {0}
xml = xml..string.format('<S H="40" P="0,0,3,0.2,%s,0,0,0" L="40" X="%s" Y="%s" o="%s" T="12" />',angle[math.random(#angle)], x*40,y*40,color)
end
end
end
xml = xml..xmlEnd
tfm.exec.newGame(xml)
tfm.exec.setGameTime('330')
end
function eventNewPlayer(p)
tfm.exec.respawnPlayer(p)
end
function genMaze(matrix, wD, hG, x, y)
local r = math.random(0, 3)
matrix[y * wD + x] = 0
for i = 0, 3 do
local d = (i + r) % 4
local dx = 0
local dy = 0
if d == 0 then
dx = 1
elseif d == 1 then
dx = -1
elseif d == 2 then
dy = 1
else
dy = -1
end
local nx = x + dx
local ny = y + dy
local nx2 = nx + dx
local ny2 = ny + dy
if matrix[ny * wD + nx] == 1 then
if matrix[ny2 * wD + nx2] == 1 then
matrix[ny * wD + nx] = 0
genMaze(matrix, wD, hG, nx2, ny2)
end
end
end
end
wD = 55
hG = 20
function eventPlayerWon(p)
place = place+1
if place == 1 then
tfm.exec.setGameTime(10)
end
end
function eventLoop(t,r)
if r < 500 then
matrix = init_matrix(wD, hG)
genMaze(matrix, wD, hG, 2, 2)
matrix[wD + 2] = 0
matrix[(hG - 2) * wD + wD - 3] = 0
setMap(matrix, wD, hG)
end
end
tfm.exec.setGameTime(1)
tfm.exec.chatMessage('<r>Bug ve Report İçin <j>Literery</j></r>',name)
|
Notes.io is a web-based application for taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000 notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 12 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team