Advertisement
Guest User

modmain.lua

a guest
Mar 9th, 2012
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.85 KB | None | 0 0
  1. --modmain.lua
  2.  
  3. RegisterObject(
  4.     logicgate,
  5.     "andgate",
  6.     function(c, x, y, r)
  7.         NewObject("andgate", c:new(x, y, r))--[[,
  8.             function(a, b)
  9.                 return a and b
  10.             end))]]
  11.     end,
  12.     true, --input
  13.     true, --output
  14.     false, --enemy
  15.     false, --jumpitem
  16.     "below", --specialdraw
  17.     "logical 'and' gate")
  18.  
  19. RegisterObject(
  20.     logicgate,
  21.     "orgate",
  22.     function(c, x, y, r)
  23.         NewObject("orgate", c:new(x, y, r,
  24.             function(a, b)
  25.                 return a or b
  26.             end))
  27.     end,
  28.     true, --input
  29.     true, --output
  30.     false, --enemy
  31.     false, --jumpitem
  32.     "below", --specialdraw
  33.     "logical 'or' gate")
  34.  
  35. RegisterObject(
  36.     logicgate,
  37.     "xorgate",
  38.     function(c, x, y, r)
  39.         NewObject("xorgate", c:new(x, y, r,
  40.             function(a, b)
  41.                 return a ~= b
  42.             end))
  43.     end,
  44.     true, --input
  45.     true, --output
  46.     false, --enemy
  47.     false, --jumpitem
  48.     "below", --specialdraw
  49.     "logical 'xor' gate")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement