Advertisement
LDDestroier

Test of Networked Game (CC)

Feb 26th, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.56 KB | None | 0 0
  1. --[[
  2.     Networked Game Test
  3. --]]
  4.  
  5. local netGames = {} --object that contains all games
  6.  
  7. local addGame = function(cfg)
  8.         return {
  9.             screen = {"","",""} --to be term.blit()'d
  10.             player = {
  11.                 [1] = {
  12.                     name = cfg.p1name
  13.                     x = -3,
  14.                     y = 0,
  15.                     col = cfg.p1col,
  16.                     dir = 0,
  17.                     trail = {},
  18.                 },
  19.                 [2] = {
  20.                     cfg.p2name
  21.                     x = 3,
  22.                     y = 0,
  23.                     col = cfg.p2col,
  24.                     dir = 0,
  25.                     trail = {}
  26.                 }
  27.             }
  28.         }
  29. end
  30.  
  31. netGames.fart = addGame({p1name="Player 1",p2name="Player 2",p1col=colors.blue,p2col=colors.red})
  32.  
  33. --to be finished!
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement