Hallo
My friend and I are making a 2D fighting game called Beat em up. We have an idea about implementing multiplayer in this game. That we tried to do is to make the player able to play with someone else through the Internet. I am a beginner and have no experience in multiplayer coding. Therefore I use a code from the codebase on tgc, and experimenting to modify so I could use this code on my project. so far have I been able to make a simple server, were the player could choosing between hosting a game or log in and join as a client using a IP address. But my problem is that I have no idea how I could move my sprite (and the other player could see that on his screen on the other end) and how the other player could move the other sprite (and I could see the player are moving on my screen). Sorry for bad explanation
Here is my code
Rem ***** Included Source File *****
multiplayer:
cls
XB360 INIT
rem __________________BEGIN MULTIPLAYER EXAMPLE_________________
sync on
sync rate 32
backdrop on
color backdrop 0
autocam off
draw to front
set text font "arial"
set text size 12
set text transparent
set camera range 1,3000
dim mpgot(10)
dim zchat$(20)
packetrate=250
rem **** CREATE GAME WORLD
rem **** FIND THE TCP/IP CONNECTION TYPE
rem sample code to setup a net connection
perform checklist for net connections
sync:sleep 50
netsel=0
nettotal=checklist quantity()
for a = 1 to nettotal
rem find the connection for TCP/IP internet
if checklist string$(a)="Internet TCP/IP Connection For DirectPlay" then netsel=a
next a
rem if TCP/IP wasn't found and netsel=0, which can occur on non-english
rem versions of windows, set the netsel variable to the last detected
rem connection type which is almost always TCP/IP anyway
if netsel=0 then netsel=nettotal
rem if no connections detected and netsel still equals 0, stop the program
if netsel=0 then end
rem **** USE WHATEVER ENTRY ROUTINE TO LET THE PLAYER SELECT THE IP ADDRESS
rem now let the player enter the IP address they want to use
ask4ip:
ky$=entry$()
if ky$="" then goto msync0
clear entry buffer
if right$(ky$,1)=chr$(13) then add$=chat$:chat$="":goto gotip
if right$(ky$,1)=chr$(8) then chat$=left$(chat$,len(chat$)-1):ky$=""
if len(chat$)>30 then ky$="":goto msync0
chat$=chat$+ky$
ky$=""
msync0:
ink rgb(255,255,255),0
text 10,10,"Enter IP address to connect to: "+chat$+"_"
sync
goto ask4ip
gotip:
sleep 500
ky$=""
rem now let the player select the name they want to use
ask4name:
ky$=entry$()
if ky$="" then goto msync1
clear entry buffer
if right$(ky$,1)=chr$(13) then goto gotname
if right$(ky$,1)=chr$(8) then playername$=left$(playername$,len(playername$)-1):ky$=""
if len(playername$)>10 then ky$="":goto msync1
playername$=playername$+ky$
ky$=""
msync1:
ink rgb(255,255,255),0
text 10,10,"IP Address selected: "+add$
text 10,20,"Enter the name you want to use: "+playername$+"_"
sync
goto ask4name
gotname:
rem **** ESTABLISH MULTIPLAYER CONNECTION
rem now establish the connection using the connection type and IP address
for i = 0 to 5
text 10,50,"Establishing connection to: "+add$
sync
next i
set net connection netsel,add$
for i = 0 to 5
text 10,70,"Connection established..."
sync
next i
rem **** NOW SCAN THE CONNECTION FOR EXISTING GAMES
rem check for active games on the IP address the player just connected to
perform checklist for net sessions
if checklist quantity()<1 then game$="None":goto nogame
game$=checklist string$(1)
nogame:
rem if a game doesn't already exit, let the player host
rem otherwise, joining the existing game is the only option
rem NOTE: you can hault the process here to let the player select
rem from a series of active games, or manually start hosting
rem this example just automates the process based on what is detected
if game$="None" then goto setashost
for i = 0 to 30
text 10,85,"Active session detected on this IP..."
text 10,100,"Joining active session as client..."
sync
next i
join net game 1,playername$
rem now send a greeting message that a new player has joined
rem this example will use MESSAGE= as a flag for a text message for the
rem chat sequence of this multiplayer routine
rem send messages three times to make sure it gets through
rem using the 0 flag will send the message to all players
for i = 0 to 2
send net message string 0,"MESSAGE="+playername$+" has joined the game!"
endif
sync
next i
cls
rem get general timer for exchange rate
tmm=timer()
oldtmm=tmm
goto multimain
setashost:
rem if game$="None" then this section starts a new game on this IP address
rem The 8 is the maximum number of players, 1 is for peer-to-peer
rem client/server is another connection option which routes all data
rem traffic through the host's computer instead of letting each player's
rem system talk directly to every other player's system
for i = 0 to 70
text 10,85,"No session detected on this IP..."
text 10,100,"Creating multiplayer session as host..."
sync
next i
create net game "Multiplayer Game #1",playername$,8,1
cls
tmm=timer()
oldtmm=tmm
multimain:
#constant bgg 6
#constant bgg2 23
#constant pplatform 2
#constant BGGscore 3
#constant Woood 54
#constant woood2 55
#constant IInvisible_Wall 13
#constant HHotspot1 44
#constant HHotspot2 45
#constant BBolge 485
#constant mm1 77
#constant mm2 78
#constant mm3 79
#constant mm4 80
Rem *********PLAYER********
#constant _TTRUE = 1
#constant _FFALSE = 0
#constant _JJUMPSPEED 4
#constant _JJUMPPOWER 15
x# = 50
y# = 685
speed# = 4
health=500
Rem *********PLAYER_ENEMY************
#constant _TTRUE2 = 1
#constant _FFALSE2 = 0
#constant _JJUMPSPEED2 4
#constant _JJUMPPOWER2 15
#constant eenemy 7
E# = 50*17
Y2# = 672
speed2# = 4
Health2 =500
Rem *********DISPLAY*********
AUTOCAM OFF
BACKDROP OFF
COLOR BACKDROP 0
SYNC
SYNC RATE 60
SYNC ON
SET DISPLAY MODE 1024, 768, 32,
Rem *********LOAD_IMAGE**********
Load image "sprites\TRYMS\industri11.jpg", bgg
Load image "sprites\TRYMS\industri1.jpg", 223
Load image "sprites\TRYMS\industri22.jpg", bgg2
Load image "sprites\TRYMS\industri.jpg", 222
Load image "sprites\TRYMS\in.jpg", 224
Load image "sprites\TRYMS\platform.png", pplatform
Load image "sprites\TRYMS\SCORE.png", BGGscore
Load image "sprites\TRYMS\wood2.png", Woood
Load image "Sprites\TRYMS\wood3.png", woood2
Load image "Sprites\TRYMS\Invisiblewall.png", IInvisible_wall
Load image "Sprites\TRYMS\Hotspothead.png", HHotspot1
Load image "Sprites\TRYMS\chest.png", HHotspot2
Load image "Sprites\TRYMS\bølgetest.png", BBolge
Load Animation "Sprites\TRYMS\Street.avi", 1
Rem *********MUSIC***************
Load music "Music\Killer instinct.mp3",mm1
Load music "Music\Charlie_Bravo.mp3",mm2
Load music "Music\Derailer.mp3",mm3
Load music "Music\All_Your_Base.wav",mm4
Rem **************SFX*****************
Load sound "SFX\test.wav",99
Rem *********ENEMY_SPRITE***********
create animated sprite 7, "sprites\TRYMS\sprite2.png", 1,1,7
sprite 7, 32*30, 672, 7
mirror sprite 7
show sprite 7
Rem *********RANDOMBOX_SPRITE***********
create animated sprite 10, "sprites\TRYMS\Randombox.png",1,1,10
sprite 10,32*77, 448,10
show sprite 10
Rem **********COIN_SPRITE***********
create animated sprite 8, "sprites\TRYMS\coin.png",1,1,8
sprite 8,32*77, 448,8
show sprite 8
create animated sprite 9, "sprites\TRYMS\coin.png",1,1,9
sprite 9,32*77, 448,9
show sprite 9
Rem ************INVISBLE_WALL/MOVING_BACKGROUND***********
Sprite 13,-10,y,13
Sprite 14,1024,y,13
XK = 0
XJ = 512
KK = 0
XH = 512
XK2 = 0
XJ2 = 512
KK2 = 0
XH2 = 512
START = 0
START2 = 0
START3 = 0
START4 = 0
STARTANIM = 0
STARTANIM2 = 0
STARTANIM3 = 0
STARTANIM4 = 0
Rem ***********HEALTH_HEART*************
create animated sprite 66,"sprites\TRYMS\Heart2.0.png",5,3,66
sprite 66,0,-50,66
delay=150
Rem ***********HEALTH_HEART*************
create animated sprite 67,"sprites\TRYMS\Heart2.0.png",5,3,67
sprite 67,630,-50,67
delay=150
Rem ***********ANIMATED_SPRITE**********
create animated sprite 1,"sprites\TRYMS\test.bmp",5,1,1 rem we divide our bmp in five frames
sprite 1,x,690,1
delay=150
x=100
y=200
state=0
Badass= 1
BAM= 0 :rem badass mode flag
coolDown= 0 :rem badass cooldown timer
Rem ********************FIGHTING_SYSTEM*************************
ROUND = 0
ROUND2 = 0
Attack = 0
Attack2 = 0
Powerup = 0
Powerup2 = 0
AIRSTOMP = 0
AIRSTOMP2 = 0
Rem **************XBOX_360_CONTROLLER***************************
XB360 INIT
mem=XB360 GET SOUND DATA MEMBLOCK ID(0)
` should be mem , not mem#
` XB360 GET SOUND DATA MEMBLOCK ID returns an integer not a float
Particles = 20 `The amount of particles that can be on the screen at a time
dim ParX#(Particles)
dim ParY#(Particles)
dim ParXS#(Particles)
dim ParYS#(Particles)
Rem **************************
snow=250
dim sx(snow)
dim sy(snow)
for t=0 to snow
sx(t)=rnd(screen width())
sy(t)=rnd(screen height()-1)
next t
Rem ***************************************************************************************
Rem ********PASTE_IMAGE/MUSIC****************************************************************
Rem *****************************************************************************************
DO
cls
Play music mm4
Paste image bgg,0,0
Paste image bgg2,512,0
for i=0 to 32
Paste image 2,32*i,736,1
next i
Rem ***********PLAYER_ANIMATION**********
if XB360 DPAD(0)=4
x=x-1
if state<>3 then state=3 : set sprite frame 1,2
play sprite 1,2,6,80
else
if XB360 DPAD(0)=8
x=x+1
if state<>4 then state=4 : set sprite frame 1,2
play sprite 1,2,6,80
endif
endif
Rem *******BACKGROUND_MOVEMENT*********
If sprite collision(1,14) and score = 3 then START = 1
If START = 1
STARTANIM2 = 1
Paste image 223,XK,0
Paste image 222,512,0
dec XK, 1
endif
If STARTANIM2 = 1
hide sprite 7
paste sprite 7,250,Y2#
endif
if XK < -512
for i=0 to -512 step -1
Paste image 224,XJ,0
show sprite 7
next i
XJ = 0
endif
If XJ = 0 then START = 1
If XK < -512 then STARTANIM2 = 0
If STARTANIM2 = 0 then sprite 7,E#,Y2#,7
Rem **********************************************
If sprite collision(7,14) and score2 = 3 then START4 = 1
If START4 = 1
STARTANIM4 = 1
Paste image 223,XK2,0
Paste image 222,512,0
dec XK2, 1
endif
If STARTANIM4 = 1
hide sprite 1
paste sprite 1,250,Y#
play sprite 1,2,6,80
endif
if XK2 < -512
for i=0 to -512 step -1
Paste image 224,XJ2,0
show sprite 1
next i
XJ2 = 0
endif
If XJ2 = 0 then START4 = 1
If XK2 < -512 then STARTANIM4 = 0
If STARTANIM4 = 0 then sprite 1,X#,Y#,1
Rem *******************************************
If sprite collision(7,13) and score2 = 3 then START2 = 1
If START2 = 1
STARTANIM = 1
Paste image 223,KK,0
Paste image 224,0,0
sprite 1,750,Y#,1
inc KK, 1
endif
If STARTANIM = 1
hide sprite 1
paste sprite 1,750,Y#,
play sprite 1,2,6,80
endif
If KK > 512
for i=0 to 0 step 1
Paste image 222,XH,0
show sprite 1
next i
XH = 512
endif
If XH = 0 then START2 = 1
If KK > 512 then STARTANIM = 0
If STARTANIM = 0 then sprite 1,X#,Y#,1
Rem **********************************************
If sprite collision(1,13) and score = 3 then START3 = 1
If START3 = 1
STARTANIM3 = 1
Paste image 223,KK2,0
Paste image 224,0,0
sprite 7,750,Y2#,7
inc KK2, 1
endif
If STARTANIM3 = 1
hide sprite 7
paste sprite 7,750,Y2#
endif
If KK2 > 512
for i=0 to 0 step 1
Paste image 222,XH2,0
show sprite 7
next i
XH2 = 512
endif
If XH2 = 0 then START3 = 1
If KK2 > 512 then STARTANIM3 = 0
If STARTANIM3 = 0 then sprite 7,E#,Y2#,7
Rem ************************************************
Paste image Woood,-50,-40,1
Paste image Woood2,50,-40,1
Paste image 3,3,20,1
Paste image 3,920,20,1
for i=0 to 32
Paste image 2,32*i,736,1
next i
Paste image BBolge,0,747,1
Rem ********SCORE********
Ink rgb(255,0,0),rgb(0,0,0)
Set text font "arial"
Set text size 50
Text 958,47,str$(score2)
Ink rgb(255,0,0),rgb(0,0,0)
Set text font "arial"
Set text size 50
Text 40,47,str$(score)
Rem ************HOTSPOTS*****************
h1x = sprite x (1)
h1y = sprite y (1)
sprite 44,h1x+20,h1y-40,44
h2x = sprite x (7)
h2y = sprite y (7)
sprite 45,h2x+31,h2y+14,44
h1x = sprite x (1)
h1y = sprite y (1)
sprite 46,h1x+20,h1y+10,45
h2x = sprite x (7)
h2y = sprite y (7)
sprite 47,h2x+20,h2y+20,45
hide sprite 44
hide sprite 45
hide sprite 46
hide sprite 47
Rem ****************************************|****************************************
Rem ****************************************|****************************************
Rem *************(((FIGHTING)))*************|****************************************
Rem ****************************************|****************************************
Rem ****************************************|****************************************
Rem *************BLOCK/ATTACK_PLAYER1***************
if XB360 X BUTTON(0)=1
attack = 1
else
if XB360 X BUTTON(0)=0 then attack = 0
endif
if XB360 X BUTTON(1)=1
attack2 = 1
else
if XB360 X BUTTON(1)=0 then attack2 = 0
endif
if attack = 1 and attack2 = 1
attack = 0
else if attack = 1 and sprite collision (1,45)
attack = 1+1
endif
endif
if Health < 0 then attack = 0
if attack = 2
dec Health2, 1
play sound 99
endif
Rem *********************COMBO1**************************
if XB360 X BUTTON(0)=1 then inc Powerup,1
if XB360 X BUTTON(0)=0 then Powerup=0
if XB360 LEFT THUMB(0)=1 then inc Powerup,1
if XB360 LEFT THUMB(0)=0 then Powerup=0
if Powerup = 2 then health2 = 100
Rem *********************COMBO1**************************
if XB360 A BUTTON(0)=1 then inc AIRSTOMP,1
if XB360 A BUTTON(0)=0 then AIRSTOMP=0
if XB360 B BUTTON(0)=1 then inc AIRSTOMP,1
if XB360 B BUTTON(0)=0 then AIRSTOMP=0
if AIRSTOMP = 2 then speed# = 8
Rem *************BLOCK/ATTACK_PLAYER2********************
if XB360 X BUTTON(1)=1
attack2 = 1
else
if XB360 X BUTTON(1)=0 then attack2 = 0
endif
if XB360 X BUTTON(0)=1
attack = 1
else
if XB360 X BUTTON(0)=0 then attack = 0
endif
if attack2 = 1 and attack = 1
attack2 = 0
else if attack2 = 1 and sprite collision (7,1)
attack2 = 1+1
endif
endif
if Health2 < 0 then attack2 = 0
if attack2 = 2
dec Health, 1
play sound 99
endif
Rem *********************COMBO2**************************
if XB360 X BUTTON(1)=1 then inc Powerup2,1
if XB360 X BUTTON(1)=0 then Powerup2=0
if XB360 LEFT THUMB(1)=1 then inc Powerup2,1
if XB360 LEFT THUMB(1)=0 then Powerup2=0
if Powerup2 = 2 then health = 100
Rem ********************************************************
if keystate(18)=1 and sprite collision (1,45)
dec health2, 2
inc score,4
play sound 99
endif
if keystate(16)=1 and sprite collision (7,44)
dec health1, 2
inc score2,4
play sound 99
endif
if keystate(16)=1 and sprite collision (7,1)
dec health, 1
play sound 99
endif
Rem ***************************************
Rem *************HEART2******************
if health2>500
Play sprite 67,1,13,100
endif
if health2<=500
Play sprite 67,1,13,75
endif
if health2<=400
Play sprite 67,1,13,50
endif
if health2<=250
Play sprite 67,1,13,25
endif
if health2<=100
Play sprite 67,1,13,10
endif
if health2<=50
Play sprite 67,1,13,2
endif
Rem ********HEART1***********
if health>500
Play sprite 66,1,13,100
endif
if health<=500
Play sprite 66,1,13,75
endif
if health<=400
Play sprite 66,1,13,50
endif
if health<=250
Play sprite 66,1,13,25
endif
if health<=100
Play sprite 66,1,13,10
endif
if health<=50
Play sprite 66,1,13,2
endif
Rem ***************ROUNDS/FATALITIES/END***********************
print health2
print health
if health2 < 0 then Text 310,30,"Press START/BACK"
if health2 < 0 and XB360 START BUTTON(1)=1
health2 = 0+500
Repeat
inc health, 1
until health = 500
inc score, 1
inc ROUND2, 1
Text 370,240, "ROUND "+str$(score)
else
if health2 < 0 and XB360 BACK BUTTON(1)=1
Text 430,280, "FATALITI"
sync
wait 3000
PLAY ANIMATION 1
while animation playing(1)
sync
hide sprite 1
hide sprite 7
hide sprite 66
hide sprite 67
endwhile
end
endif
endif
if ROUND2 = 3 and Health2 < 0
Text 370,240, "FATALITI"
stop music mm4
PLAY ANIMATION 1
while animation playing(1)
sync
endwhile
end
endif
if health < 0 then Text 310,30,"Press START/BACK"
if health < 0 then attack = 0
if health < 0 and XB360 START BUTTON(0)=1
health = 0+500
Repeat
inc health2, 1
until Health2 = 500
inc score2, 1
inc ROUND, 1
Text 370,240, "ROUND "+str$(score2)
else
if health < 0 and XB360 BACK BUTTON(0)=1
Text 430,280, "FATALITI"
sync
wait 3000
PLAY ANIMATION 1
while animation playing(1)
sync
hide sprite 1
hide sprite 7
hide sprite 66
hide sprite 67
endwhile
end
endif
endif
if ROUND = 3 and Health < 0
Text 370,240, "FATALITI"
stop music mm4
PLAY ANIMATION 1
while animation playing(1)
sync
endwhile
end
endif
Rem *********COMBO_BADASS***********
if XB360 RIGHT SHOULDER(0)=1 then inc state2,1
if XB360 RIGHT SHOULDER(0)=0 then state2=0
if XB360 Y BUTTON(0)=1 then inc state2,1
if XB360 Y BUTTON(0)=0 then state2=0
if XB360 LEFT THUMB(0)=1 then inc state2,1
if XB360 LEFT THUMB(0)=0 then state2=0
if state2>3
Seconds=3:
T=Timer()
Repeat
Elapsed=(Timer()-T)/1000
TimeLeft=Seconds-Elapsed
Rem effects
Until TimeLeft<=0
endif
if BAM = 1
scale sprite 1,500
x# = x# + (XB360 DPAD(0)=8)*speed#
x# = x# + (XB360 DPAD(0)=9)*speed#
x# = x# + (XB360 DPAD(0)=10)*speed#
x# = x# - (XB360 DPAD(0)=4)*speed#
x# = x# - (XB360 DPAD(0)=5)*speed#
x# = x# - (XB360 DPAD(0)=6)*speed#
sprite 1,x#,y3#,1
if XB360 A BUTTON(0)=1 then _Jump = _TTRUE
if _Jump = _TTRUE
inc jump#,_JJUMPSPEED2
y3# = y3#-_JJUMPPOWER2*cos(jump#)
if jump# = 180
y3# = 480
jump# = 0
_Jump = _FFALSE
ENDIF
ENDIF
ENDIF
Text 350,47,(msg$)
if state2>3 and coolDown <=0
BAM = 1
msg$= "BADASS MODE!"
coolDown = 1 :rem doesn't actually matter what value this is as long as it's positive.
BAMt= timer()
endif
if BAM = 0 then scale sprite 1, 100
if coolDown >0
coolDown= 20000 - (timer() - BAMt)
if coolDown <10000
BAM= 0
msg$= "COOLDOWN "+str$(cooldown/100)+""
endif
else
msg$= ""
endif
if XB360 LEFT SHOULDER(0)=1 then print "LEFT SHOULDER"
if XB360 RIGHT THUMB(0)=1 then print "RIGHT THUMB"
Rem ********JUMP_ENEMY*********
E# = E# + (XB360 DPAD(1)=8)*speed2#
E# = E# + (XB360 DPAD(1)=9)*speed2#
E# = E# + (XB360 DPAD(1)=10)*speed2#
E# = E# - (XB360 DPAD(1)=4)*speed2#
E# = E# - (XB360 DPAD(1)=5)*speed2#
E# = E# - (XB360 DPAD(1)=6)*speed2#
sprite 7,E#,Y2#,7
if XB360 A BUTTON(1)=1 then _Jump2 = _TTRUE2
if _Jump2 = _TTRUE2
inc jump2#,_JJUMPSPEED
Y2# = Y2#-_JJUMPPOWER*cos(jump2#)
if jump2# = 180
Y2# = 672
jump2# = 0
_Jump2 = _FFALSE2
ENDIF
ENDIF
Rem *********JUMP_PLAYER*********
if STARTANIM = 0
if Bam = 0
x# = x# + (XB360 DPAD(0)=8)*speed#
x# = x# + (XB360 DPAD(0)=9)*speed#
x# = x# + (XB360 DPAD(0)=10)*speed#
x# = x# - (XB360 DPAD(0)=4)*speed#
x# = x# - (XB360 DPAD(0)=5)*speed#
x# = x# - (XB360 DPAD(0)=6)*speed#
sprite 1,x#,y#,1
if XB360 A BUTTON(0)=1 then _Jump = _TTRUE
if _Jump = _TTRUE
inc jump#,_JJUMPSPEED2
y# = y#-_JJUMPPOWER2*cos(jump#)
if jump# = 180
y# = 685
jump# = 0
_Jump = _FFALSE
ENDIF
ENDIF
ENDIF
ENDIF
Rem ********MAIN_MENU**********
If escapekey()=1
cls
stop music mm4
goto Main_menu
Endif
Rem ***************************
Rem Variables for the xy mouse positions and the xy mouse speed
MX# = sprite X (45)
MY# = sprite Y (45)
MMX# = MouseMoveX()=0
MMY# = MouseMoveY()=0
Rem Create particles when the user clicks the mouse
if attack = 1 and sprite collision (1,45)
for i = 1 to 20 `makes three particles at a time
Particle = Particle + 1
if Particle > Particles then Particle = 0
`positions the particles to the position of the mouse
ParX#(Particle) = MX#
ParY#(Particle) = MY#
ParXS#(Particle) = (MMX#)+(rnd(100)-50)/10.0 `randomizes the x-speed of the particles
ParYS#(Particle) = (MMY#)+(rnd(100)-50)/20.0 `randomizes the y-speed of the particles
next i
endif
Rem Draws all of the particles
for i = 1 to Particles
ink rgb(255,0,0),0 `Adds color to the particles
line ParX#(i),ParY#(i),ParX#(i)+ParXS#(i),ParY#(i)+ParYS#(i) `draws the particle
ParX#(i) = ParX#(i)+ParXS#(i) `updates the particles x position
ParY#(i) = ParY#(i)+ParYS#(i) `updates the particles y position
if ParX#(i) <= 0 then ParXS#(i)=-ParXS#(i)/1.5 `bounces the particles on the left wall
if ParX#(i) >= 1024 then ParXS#(i)=-ParXS#(i)/1.5 `bounces the particles on the right wall
if ParY#(i) >= 768 then ParYS#(i)=-ParYS#(i)/1.5 `bounces the particles on the floor
ParYS#(i) = ParYS#(i) +0.1 `Particles Gravity
next i
for t=0 to snow
if sy(t)=screen height()-1 then sy(t)=0
v=rnd(15)+1
ink rgb(0,0,0),1
dot sx(t),sy(t)
if v<6 then sx(t)=sx(t)+1
if v>10 then sx(t)=sx(t)-1
sy(t)=sy(t)+1
if sy(t)>screen height()-1 then sy(t)=screen height()
ink rgb(255,255,255),1
dot sx(t),sy(t)
next t
ink rgb(255,255,255),0
rem get a continuous list of all players
text 10,10,"Current players:"
perform checklist for net players
totalplayers=checklist quantity()
for i = 1 to totalplayers
rem now save each player's unique ID number to the MPGOT array
rem to help keep track of each specific player more accurately
mpgot(i-1)=checklist value b(i)
rem grab the name of each player in the session
name$=checklist string$(i)
rem if name on the list matches this player, get the unique ID number as
rem we'll need it later for transmitting packets
if name$=playername$ then playernum=checklist value b(i)
rem display each name in the upper left of the screen
text 10,10+(i*10),name$
next i
xb360 poll 3
SYNC
cls
LOOP
Thanks for answers