Stormworks:交通管制情報処理システムらしきもの
Stormworksで作成した『交通管制情報処理システムらしきもの(仮)』をメモ代わりに公開コピペ等ご自由にして下さいまた当方プログラミングの初心者なのでここをこうしたほうが良いなどのアドバイスがあったらありがたいです名前も募集中です(-_-;)※予告なく記事内容は編集されることがあります———————————————————————————————————————————local mx = mapXlocal my = mapYlocal sw = screenWlocal sh = screenHlocal px = pixelXlocal py = pixelYlocal wx = worldXlocal wy = worldYfunction onTick() in1 = input.getNumber(1) in2 = input.getNumber(2) zoom = input.getNumber(3) in3 = input.getNumber(4) in4 = input.getNumber(5) x = in1+in3*zoom y = in2+in4*zoom --No,1 x2 = input.getNumber(6) y2 = input.getNumber(7) sp2 = input.getNumber(8) al2 = input.getNumber(9) --No,2 x3 = input.getNumber(10) y3 = input.getNumber(11) sp3 = input.getNumber(12) al3 = input.getNumber(13) --No,3 x4 = input.getNumber(14) y4 = input.getNumber(15) sp4 = input.getNumber(16) al4 = input.getNumber(17) --No,4 x5 = input.getNumber(18) y5 = input.getNumber(19) sp5 = input.getNumber(20) al5 = input.getNumber(21) --No,5 x6 = input.getNumber(22) y6 = input.getNumber(23) sp6 = input.getNumber(24) al6 = input.getNumber(25)endfunction onDraw()--Mapscreen.drawMap(x, y, zoom)--screen W/Hsw = screen.getWidth()sh = screen.getHeight() --My Position px, py = map.mapToScreen(x, y, zoom, sw, sh, in1, in2) screen.setColor(255, 0, 0) screen.drawCircleF(px, py, 2 / zoom)--No,1px1, py1 = map.mapToScreen(x, y, zoom, sw, sh, x2, y2)screen.setColor(0, 0, 0, x2 / x2 * 255)screen.drawCircleF(px1, py1, x2 / x2 * 5 / zoom)screen.drawLine(px1, py1, px1 + 10, py1 + 10)screen.drawText(px1 + 10, py1 + 12, "Frequency:1")screen.drawText(px1 + 10, py1 + 18, string.format("%.1f", sp2))screen.drawText(px1 + 35, py1 + 18, "KPH")screen.drawText(px1 + 10, py1 + 24, string.format("%.1f", al2))screen.drawText(px1 + 35, py1 + 24, "M")--No,2px2, py2 = map.mapToScreen(x, y, zoom, sw, sh, x3, y3)screen.setColor(0, 0, 0, x3 / x3 * 255)screen.drawCircleF(px2, py2, x3 / x3 * 4)screen.drawLine(px2, py2, px2 + 10, py2 + 10)screen.drawText(px2 + 10, py2 + 12, "Frequency:2")screen.drawText(px2 + 10, py2 + 18, string.format("%.1f", sp3))screen.drawText(px2 + 35, py2 + 18, "KPH")screen.drawText(px2 + 10, py2 + 24, string.format("%.1f", al3))screen.drawText(px2 + 35, py2 + 24, "M")--No,3px3, py3 = map.mapToScreen(x, y, zoom, sw, sh, x4, y4)screen.setColor(0, 0, 0, x4 / x4 * 255)screen.drawCircleF(px3, py3, x4 / x4 * 4)screen.drawLine(px3, py3, px3 + 10, py3 + 10)screen.drawText(px3 + 10, py3 + 12, "Frequency:3")screen.drawText(px3 + 10, py3 + 18, string.format("%.1f", sp4))screen.drawText(px3 + 35, py3 + 18, "KPH")screen.drawText(px3 + 10, py3 + 24, string.format("%.1f", al4))screen.drawText(px3 + 35, py3 + 24, "M")--No,4px4, py4 = map.mapToScreen(x, y, zoom, sw, sh, x5, y5)screen.setColor(0, 0, 0, x5 / x5 * 255)screen.drawCircleF(px4, py4, x5 / x5 * 4)screen.drawLine(px4, py4, px4 + 10, py4 + 10)screen.drawText(px4 + 10, py4 + 12, "Frequency:4")screen.drawText(px4 + 10, py4 + 18, string.format("%.1f", sp5))screen.drawText(px4 + 35, py4 + 18, "KPH")screen.drawText(px4 + 10, py4 + 24, string.format("%.1f", al5))screen.drawText(px4 + 35, py4 + 24, "M")--No,5px5, py5 = map.mapToScreen(x, y, zoom, sw, sh, x6, y6)screen.setColor(0, 0, 0, x6 / x6 * 255)screen.drawCircleF(px5, py5, x6 / x6 * 4)screen.drawLine(px5, py5, px5 + 10, py5 + 10)screen.drawText(px5 + 10, py5 + 12, "Frequency:5")screen.drawText(px5 + 10, py5 + 18, string.format("%.1f", sp6))screen.drawText(px5 + 35, py5 + 18, "KPH")screen.drawText(px5 + 10, py5 + 24, string.format("%.1f", al6))screen.drawText(px5 + 35, py5 + 24, "M")end