|
Post by bluatigro on Feb 15, 2019 5:27:05 GMT -5
i want to create a set of wireles nenwork games
?1: do i use BT or wifi ?
?2: has anyone done this already ?
i sugesting battelship as a start [ 2 player's have a square whit ships ] [ and try to hit the other's ones ships ] [ by guesing coordinates ]
?3: is it posible to conect more that 2 pc's ?
|
|
|
Post by bluatigro on Feb 15, 2019 6:27:42 GMT -5
a batle ship game is more complex than i toth so lets start whit a chat service
WindowWidth = DisplayWidth WindowHeight = DisplayHeight global winx , winy , linelen , cursorx , cursory , state global human , comp , size , in$ , crsr dim p$( 80 , 25 ) winx = WindowWidth winy = WindowHeight linelen = 60 human = 0 comp = 1 size = int( winx / linelen ) nomainwin open "chat 0.1" for graphics as #m #m "trapclose [quit]" #m "when characterInput [key]" #m "font Courier_new " ; int( size * .8 ) ; " bold" #m "color yellow" #m "backcolor black" #m "fill black" #m "setfocus" timer 250 , [tmr] wait [tmr] crsr = 1 - crsr if crsr then #m "backcolor yellow" else #m "backcolor black" end if #m "goto " ; cursorx * size ; " " ; cursory * size + size #m "down" #m "\ " #m "up" wait sub letter a$ , kl$ #m "goto " ; cursorx * size ; " " ; cursory * size + size #m "color " ; kl$ #m "backcolor black" #m "down" #m "\" ; a$ #m "up" p$( cursorx , cursory ) = a$ cursorx = cursorx + 1 if cursorx > linelen then cursorx = 0 cursory = cursory + 1 if cursory > 25 then call shiftscreen cursury = 25 end if end if end sub sub write a$ , kl$ for i = 1 to len( a$ ) call letter mid$( a$ , i , 1 ) , kl$ next i end sub sub shiftscreen for y = 0 to 24 for x = 0 to 80 p$( x , y ) = p$( x , y + 1 ) #m "goto " ; x * size ; " " ; y * size + size #m "down" #m "\" ; p$( x , y ) #m "up" next x next y end sub [key] key$ = right$( Inkey$ , 1 ) if key$ = chr$( 27 ) then close #m end end if if state = human then in$ = "" if key$ = chr$( 13 ) then call letter " " , "yellow" for i = 0 to cursorx - 1 in$ = in$ + p$( cursory , i ) next i call sent.over.net in$ state = comp end if if ( key$ >= "a" _ and key$ <= "z" ) _ or ( key$ >= "A" _ and key$ <= "Z" ) _ or ( key$ >= "1" _ and key$ <= "0" ) _ or key$ = " " then call letter key$ , "yellow" end if end if if state = comp then cursorx = 0 cursory = cursory + 1 call write "OK" , "cyan" ''get.from.net$() , "cyan" state = human cursorx = 0 cursory = cursory + 1 end if wait [quit] close #m end sub sent.over.net mesage$ end sub function get.from.net$() end function
|
|
|
Post by bluatigro on Feb 17, 2019 6:01:10 GMT -5
eventualy i want to create "wifimaze' senario : 2 … 4 player's are in a mazed and try to shoot earch other and there are ninja's and dummy's for extra point's ninja's shoot back dummy's not for graphics i plan to use openGL
it is based on a old game called midimaze that had to up 16 (!) player's
|
|