Jump to content




Multiplayer Game Help


  • You cannot reply to this topic
4 replies to this topic

#1 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 24 April 2012 - 08:01 PM

I am making a gmae for Noodle-SH but I need help for multiplayer.
I have a sprite which is "o" (soon to be changed).

I need to be able to draw a new sprite when someone connects to an ID of the computer.
Example:
term.clear()
term.setCursorPos(1,1)
local currentX = 25
local currentY = 9
local sprite = "o"
write "Type the id you would like to join: "
local c = read()

-- Now for the movements
if event == key and key == "w" -- ik.. the id's, but im at school
currentY = currentY - 1
rednet.send(c, "up")
end

-- Receive code
id, msg = rednet.receive()
if id == c and msg == "up" then -- THE C IS ALSO ON THE OTHER COMPUTER TO JOIN SOMEONE ELSE IP - IP (Connecting)
(OtherOBJECT) currentY = (OtherOBJECT) currentY - 1
end


#2 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 24 April 2012 - 09:31 PM

Nvm fixed xD
When event: Join - Happens it makes new sprite at the spawn location.

#3 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 24 April 2012 - 09:44 PM

Hmm.. Can anyone help with
loading a sprite?
sprite2.currentx ??

#4 ComputerCraftFan11

  • Members
  • 771 posts
  • LocationHawaii

Posted 25 April 2012 - 02:18 AM

Instead of doing rednet.recieve
Try:
if event == "rednet_messege" then

To recieve and move at the same time

#5 Noodle

  • Members
  • 989 posts
  • LocationSometime.

Posted 25 April 2012 - 02:22 AM

Where to put this?

http://www.computerc...__fromsearch__1
there is the new code i have made... Currently need help





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users