hey all, since i made a WIP of my MMORPG game, everyone's asking me how i did the chat system in my game that works in loop.
so seems like almost all dont know how to do the chat thingy in loop.
so here is few examples:
u5.9 (18 lines):
dim MyChat$(100) `chat array
do
cls
inc T `timer for the "_" thingy to show you that u are typing
msg$ = entry$() `that is the command that returns the typing.
if returnkey()=1 then AddNewMsg(msg$) : clear entry buffer `after enter, adding it to the chat array
if t > 10 and t < 100 then t$ = "_" else t$ = ""
if t = 200 then t = 0
text 0,0,"Text: "+msg$+t$ `this is a place where you typing
for a = 1 to 100
text 0,0+(15*a),"Me: "+MyChat$(a) `thats the chat show
next a
loop
function AddNewMsg(msg$) `this is adding function(adding msg to the array)
for a= 1 to 100
if MyChat$(a) = "" then MyChat$(a) = msg$ : exitfunction
next a
endfunction
u58 and u60b1 (19 lines):
dim MyChat$(100)
do : cls : inc T
if keystate(14)=0 and returnkey()=0
msg$ = msg$ + entry$()
else
if keystate(14)=1 and entry$()<>"" then msg$ = left$(msg$,len(msg$)-1)
endif
if returnkey()=1 then AddNewMsg(msg$)
if t > 10 and t < 100 then t$ = "_" else t$ = ""
if t = 200 then t = 0
text 0,0,"Text: "+msg$+t$
for a = 1 to 100 : text 0,0+(15*a),"Me: "+MyChat$(a) : next a
clear entry buffer
loop
function AddNewMsg(msg$)
for a= 1 to 100
if MyChat$(a) = "" then MyChat$(a) = msg$ : exitfunction
next a
endfunction
(havent tryed that one)