Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- elements.allocate("MAM","WARS")
- elements.element(elements.MAM_PT_WARS,elements.element(elements.DEFAULT_PT_DUST))
- elements.property(elements.MAM_PT_WARS,"Name","WARS")
- elements.property(elements.MAM_PT_WARS,"Description","MAM warring spins")
- elements.property(elements.MAM_PT_WARS,"Colour",0x6bba99)
- elem.property(elem.MAM_PT_WARS, "MenuVisible", 1)
- elem.property(elem.MAM_PT_WARS, "MenuSection", elem.SC_SPECIAL)
- elem.property(elem.MAM_PT_WARS, "Advection", 0.9)
- elem.property(elem.MAM_PT_WARS, "AirDrag", 0.42)
- elem.property(elem.MAM_PT_WARS, "AirLoss", 0.01)
- elem.property(elem.MAM_PT_WARS, "Loss", 0.364)
- elem.property(elem.MAM_PT_WARS, "Collision", -0.2)
- elem.property(elem.MAM_PT_WARS, "Gravity", 0)
- elem.property(elem.MAM_PT_WARS, "Diffusion", 0)
- elem.property(elem.MAM_PT_WARS, "HotAir", 0.008)
- elem.property(elem.MAM_PT_WARS, "Explosive", 0)
- elem.property(elem.MAM_PT_WARS, "Flammable", 0)
- elem.property(elem.MAM_PT_WARS, "Hardness", 1)
- elem.property(elem.MAM_PT_WARS, "Meltable", 0)
- elem.property(elem.MAM_PT_WARS, "Weight", 24)
- elem.property(elem.MAM_PT_WARS, "HeatConduct", 60)
- elem.property(elem.MAM_PT_WARS, "Temperature", 273)
- elem.property(elem.MAM_PT_WARS, "Falldown", 0.05)
- elem.property(elem.MAM_PT_WARS, "State", elem.ST_PART)
- elem.property(elem.MAM_PT_WARS, "Properties", elem.TYPE_PART + elem.PROP_LIFE_DEC + elem.PROP_LIFE_KILL_DEC)
- elem.property(elem.MAM_PT_WARS, "LowPressure", IPL)
- elem.property(elem.MAM_PT_WARS, "LowPressureTransition", NT)
- elem.property(elem.MAM_PT_WARS, "HighPressure", IPH)
- elem.property(elem.MAM_PT_WARS, "HighPressureTransition", NT)
- elem.property(elem.MAM_PT_WARS, "LowTemperature", ITL)
- elem.property(elem.MAM_PT_WARS, "LowTemperatureTransition", NT)
- elem.property(elem.MAM_PT_WARS, "HighTemperature", ITH)
- elem.property(elem.MAM_PT_WARS, "HighTemperatureTransition", NT)
- local Yref
- local Lposbrushx
- local Rposbrushx
- local leftAnchorPosX
- local leftAnchorPosY
- local rightAnchorPosX
- local rightAnchorPosY
- local function WARS_update(i,x,y,ss,nt)
- --print("ss: ", ss, " nt: ", nt)
- leftAnchorPosX, leftAnchorPosY = sim.partPosition(leftAnchorID)
- rightAnchorPosX, rightAnchorPosY = sim.partPosition(rightAnchorID)
- rndcrit = math.random(0, 380)
- if rndcrit == 380 then
- --print(Yref)
- --print("rndcrit: ", rndcrit)
- sim.partCreate(-3, Lposbrushx, Yref, elem.DEFAULT_PT_GRAV)
- sim.partCreate(-3, Rposbrushx, Yref, elem.DEFAULT_PT_GRAV)
- end
- end
- local function drawcall()
- --print("drawcall!", leftAnchorPosX, rightAnchorPosY)
- if leftAnchorPosX and leftAnchorPosY and rightAnchorPosX and rightAnchorPosY and elements[tpt.selectedl]==elements.MAM_PT_WARS then
- tpt.drawline(leftAnchorPosX, leftAnchorPosY, rightAnchorPosX, rightAnchorPosY)
- end
- end
- elements.property(elem.MAM_PT_WARS, "Update", WARS_update)
- local function mousedownWARS (mouseX, mouseY, button)
- if button==1 and elements[tpt.selectedl]==elements.MAM_PT_WARS and mouseX<612 and mouseX>0 and mouseY<383 and mouseY>0 then
- Yref=mouseY
- print(mouseX, mouseY, button, tpt.brushx, tpt.brushy)
- Lposbrushx = mouseX - tpt.brushx
- Rposbrushx = mouseX + tpt.brushx
- leftAnchorID = sim.partCreate(-1, Lposbrushx, mouseY, elem.DEFAULT_PT_GRAV)
- rightAnchorID = sim.partCreate(-1, Rposbrushx, mouseY, elem.DEFAULT_PT_GRAV)
- --event.register(event.tick, drawcall)
- end
- end
- event.register(event.mousedown, mousedownWARS)
- -- You must return cache, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, and fireb in that order
- function graphics(i, colr, colg, colb)
- --graphics.drawline(25, 120, 300, 85)
- colr= math.random(30, 240)
- colg= math.random(30, 240)
- colb= math.random(30, 240)
- return 0,0x000000020, 255,colr,colg,colb, 255, 255, 0, 0
- end
- tpt.graphics_func(graphics, elements.MAM_PT_WARS)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement