Teleport - Transformice.cz

--solidity
tfm.exec.newGame()
tfm.exec.setUIMapName("<J><i><b>M<b>a<b>t<b
>t<b>q<b>o</b></b></b></b></b></b></i>")
ui.addTextArea(0, "<font size='12' face='Levenim
MT' color='#000000' >
<b>w<b>w<b>w<b>.<b>t<b>r<b>a<b>n<b>s<b>f<b
>o<b>r</b><b>m<b>i<b>c<b>e<b>.<b>c<b>z</b></
b></b></b></b></b></b></b></b></b></b></b></b></b
></b></b></b></b></font>",nil,20,385,350,20,nil,0x0
00000,0,true)
id=100
def={}
def[0]={width=1, height=1}
def[1]={width=30, height=30}
def[2]={width=60, height=60}
def[3]={width=100, height=10}
def[4]={width=200, height=10}
def[6]={type=13, width=15, height=15}
function eventLoop(time, remaining)
if remaining<500 then
local sx, sy=math.random(50,
1150), math.random(100, 400)
local fx,
fy=math.fmod(sx+math.random(600, 800),
1200), math.random(100, 400)
tfm.exec.newGame(
"<C><P L='1200'/><Z><S><S
L='100' H='10' X='"..sx.."' Y='"..sy.."'/></S>"..
"<D><T X='"..sx.."' Y='"..(sy5).."'/><F X='"..fx.."'
Y='"..fy.."'/></D><O/></Z></C>"
)
end
end
function eventNewGame()
players=0
for name, player in
pairs(tfm.get.room.playerList) do
players=players+1
end
end
function eventPlayerLeft()
players=players-1
if players<=0 then
eventLoop(0, 0)
end
end
eventPlayerWon=eventPlayerLeft
eventPlayerDied=eventPlayerLeft
function eventSummoningEnd(name, type, x,
y, angle, xs, ys, data, other)
if def[type] then
id=id+2
local p=def[type]
tfm.exec.removeObject(data.id)
tfm.exec.addPhysicObject(id, x, y,
{
type=p.type or 0,
width=p.width,
height=p.height,
foreground=not data.ghost,
friction=0.2,
restitution=0.1,
angle=angle,
color=0xffcc44,
miceCollision=not data.ghost,
groundCollision=true,
dynamic=false
})
if data.ghost then
angle=angle/180*math.pi
local d=p.width/2-p.height/2
local p1,
p2=math.cos(angle)*d, math.sin(angle)*d
if p1==p2 then p2=p2+1 end
tfm.exec.addJoint(id+1, id, id,
{
type=0,
point1=math.floor(x+p1)..
","..math.floor(y+p2),
point2=math.floor(xp1)..","..math.floor(y-p2),
line=p.height*(p.type==1
3 and 2 or 1),
color=0x6A7495,
alpha=0.6,
foreground=true
})
end
end
end
tfm.exec.disableAutoNewGame(true)
eventLoop(0, 0)
print("<p align='left'>\n <n>Ahojte \n
<n>Všetko čo vyčarujete sa premení na
pevný objekt! \n <j> Veľa šťastia!\n\n <j>
www.transformice.cz</p>")