864 posts
Location
Sometime.
Posted 25 April 2012 - 02:44 AM
http://pastebin.com/zJGJH4AiAbove is the code.
Both computers connect and they can move around and stuff but it doesn't show on the other's computer?
I use vars for the send and connecting.
It sends a msg rednet.send(player2, "up") and when the other computer receives it should do
currentY = currentY - 1
drawSprite() – redraws the screen.
But it doesnt seem to do that?
718 posts
Location
Hawaii
Posted 25 April 2012 - 03:26 AM
http://pastebin.com/f0QB7bxDThis should fix it.
It never worked because it never received
The second while true do will never happen until the first is canceled
I changed it to elseif event == "rednet_message" then
P.S. wanna be in nexus again?
864 posts
Location
Sometime.
Posted 25 April 2012 - 03:38 AM
It didn't work?
But I get: "the second while true do will never happen until the first is canceled"
So attach all them together?
I GET IT!
And no.. Not nexus again. Head of OS Dev I was… Now im gone.
864 posts
Location
Sometime.
Posted 25 April 2012 - 04:45 AM
http://pastebin.com/NxefAEXTHelp please! I fixed still not working!
1111 posts
Location
Portland OR
Posted 25 April 2012 - 05:23 AM
First off the edit feature is a nice thing to use on the forums..
Second try this, I just slightly changed the if logic and added in breaks to stop the loops prior to moving to the next function. Everything else looks correct.
Spoiler
function movementMulti()
while true do
event, key, command = os.pullEvent()
if event == "key" then
if key == 17 and currentY >= 1 then
currentY = currentY - 1
rednet.send(player2, "up")
drawSpriteMulti()
break
elseif key == 31 and currentY <= 18 then
currentY = currentY + 1
rednet.send(player2, "down")
drawSpriteMulti()
break
elseif key == 30 and currentX >= 1 then
currentX = currentX - 1
rednet.send(player2, "left")
drawSpriteMulti()
break
elseif key == 32 and currentX <= 50 then
currentX = currentX + 1
rednet.send(player2, "right")
drawSpriteMulti()
break
end
elseif event == "rednet_message" then
if key == player2 and command == "up" then
currentY2 = currentY2 - 1
drawSpriteMulti()
break
elseif key == player2 and command == "down" then
currentY2 = currentY2 + 1
drawSpriteMulti()
break
elseif key == player2 and command == "left" then
currentX2 = currentX2 - 1
drawSpriteMulti()
break
elseif key == player2 and command == "right" then
currentX2 = currentX2 + 1
drawSpriteMulti()
break
else
drawSpriteMulti()
break
end
end
end
end
864 posts
Location
Sometime.
Posted 25 April 2012 - 01:13 PM
I see what you did there.. I'ma try.
864 posts
Location
Sometime.
Posted 25 April 2012 - 01:18 PM
Ahh.. no it didn't work.
92 posts
Posted 25 April 2012 - 01:41 PM
Edit: never mind