63 posts
Location
The Netherlands
Posted 16 March 2012 - 04:10 PM
Like
function(printold, printnew)
print = printtext[printold]
text = print .. _text
If u see what i mean
724 posts
Posted 17 March 2012 - 05:42 AM
Can you see it yourself?
63 posts
Location
The Netherlands
Posted 17 March 2012 - 09:26 AM
What u mean, i just want a system so i can move pieces without i need tons of functions. It edits the table;
function movePiece(newx, newy, oldshortcut, newshortcut)
unitSelected = t[oldshortcut]
unitSelected .. _x = newx
unitSelected .. _y = newy
if t[newshortcut] ~= "Nothing" then
term.setCursorPos(19,15)
print("You hit a piece from " .. turn .. "'s team!")
end
t[oldshortcut] = "Nothing"
t[newshortcut] = unitSelected
end
724 posts
Posted 17 March 2012 - 03:04 PM
If your units are tables…
function movePiece(newx, newy, oldshortcut, newshortcut)
unitSelected = t[oldshortcut]
unitSelected.x = newx
unitSelected.y = newy
if not t[newshortcut]==nil then
term.setCursorPos(19,15)
print("You hit a piece from " .. turn .. "'s team!")
end
t[oldshortcut] = nil
t[newshortcut] = unitSelected
end