
-----------------------------------
paulkwatyra
Sun Nov 20, 2005 3:11 pm

NET GAME
-----------------------------------
Hey pplz k im new at turing and i have made a game very simple
%%%%%%%%%%%%%%%%%%%%%%%%%
var chars,chars2:array char of boolean
var x,y,x2,y2:int
x := 250
y := 200
x2 := 400
y2 := 400


loop

Input.KeyDown (chars)

if chars (KEY_UP_ARROW) then     %player one movement up%
    y := y + 10
end if
if chars (KEY_RIGHT_ARROW) then        %right%
    x := x + 10
end if
if chars (KEY_LEFT_ARROW) then       %left%
    x := x - 10
end if
if chars (KEY_DOWN_ARROW) then       %down%
    y := y - 10
end if
Draw.FillOval (x, y, 4, 4, 13)




Input.KeyDown (chars2)

if chars2 ('w') then     %player two movement up%
    y2 := y2 + 10
end if
if chars2 ('d') then     %right%
    x2 := x2 + 10
end if
if chars2 ('a') then     %left%
    x2 := x2 - 10
end if
if chars2 ('s') then     %down%
    y2 := y2 - 10
end if


Draw.FillOval (x2, y2, 4, 4, 60)

delay (20)
cls
end loop
%%%%%%%%%%%%%%%%%%%%%%%
and i thought to myself i would like to make it a network game where one person can play from his computer and the other from his, and i have NO clue how to do that im somewhat familiar with opening a network however i dont understand how to transfer info from the ball variables that are moving HELP WOULD BE GREAT

-----------------------------------
[Gandalf]
Sun Nov 20, 2005 6:10 pm


-----------------------------------
Please don't double post, especially topics.

Look in the tutorials section for help before posting here, as it happens, we have a .NET tutorial:

Turing Walkthrough - http://www.compsci.ca/v2/viewtopic.php?t=8808
.NET tutorial - http://www.compsci.ca/v2/viewtopic.php?t=5795

-----------------------------------
Mr. T
Sun Nov 20, 2005 7:30 pm

Re: NET GAME
-----------------------------------
and i thought to myself i would like to make it a network game where one person can play from his computer and the other from his, and i have NO clue how to do that im somewhat familiar with opening a network however i dont understand how to transfer info from the ball variables that are moving HELP WOULD BE GREAT
I think it's best if you learn the basics before getting into the more intricate elements of programming.

-----------------------------------
paulkwatyra
Sun Nov 20, 2005 8:55 pm


-----------------------------------
i do know programming i just dont understand how networks work in turing

-----------------------------------
Cervantes
Sun Nov 20, 2005 9:03 pm


-----------------------------------
i do know programming i just dont understand how networks work in turing
If you were about ready to learn about networking, you'd have a View.Update in there (not that that's related to networking, but it is basic).  You'd only be using one array char of boolean (again, not that it's related...).  You'd be using a coordinate variable type.

I suggest you use the Turing Walkthrough to work your way towards networking.

-----------------------------------
paulkwatyra
Sun Nov 20, 2005 9:09 pm


-----------------------------------
I completed the rest of my game today and i need to know how to network it i am posting the game for some help so if neone can help me that'll be great, plz dont take ne parts from game. Also note this game is still in the finishing stage so there are some bugs as i still have a week to finish it for my project at skool


[/code]





THANX A LOT

-----------------------------------
md
Sun Nov 20, 2005 9:16 pm


-----------------------------------
I sugest you learn a lot more about types (records?), procdures, and functions before you even think of trying to do anything with the network. Networking is an advanced topic, whch required a very good knowledge of the basic principles of good programming. Your code shows that you don't even understand the basics. That's not to insult you or anything, just point out that you're trying to do something that is far beyond your abilities; a much better idea right now would be to take the code you posed and re-write it using types and functions. If you can get that done and understand it (and know why it's better) then you might be able to handle some networking.

-----------------------------------
paulkwatyra
Sun Nov 20, 2005 9:25 pm


-----------------------------------
alright good idea thanx a lot

-----------------------------------
Mr. T
Sun Nov 20, 2005 10:33 pm

Alex's Opinion
-----------------------------------
Hey pplz k im new at turing and i have made a game very simple

i do know programming i just dont understand how networks work in turing
Maybe I misunderstood your first statement.

-----------------------------------
Tony
Sun Nov 20, 2005 10:56 pm

Re: Alex's Opinion
-----------------------------------
Hey pplz k im new at turing and i have made a game very simple

i do know programming i just dont understand how networks work in turing
Maybe I misunderstood your first statement.
I seem to be misunderstanding a lot of things..

from ok so im pretty good with the entire turing language and i want to learn a new one

-----------------------------------
Mr. T
Sun Nov 20, 2005 11:27 pm

Alex's Opinion
-----------------------------------
ok so im pretty good with the entire turing language and i want to learn a new one... i am new at programming tho as i just learned turing this year
Quite the hypocrite, indeed.

-----------------------------------
MysticVegeta
Sun Nov 20, 2005 11:47 pm


-----------------------------------
Come on Come on guys! Lets not forget, people will do anything for help, and the opposite of that thing to get ahead, I find this guy smart, maybe he should take a break from programming and do some business!
sarcasm intended

-----------------------------------
[Gandalf]
Mon Nov 21, 2005 1:50 am

Re: Alex's Opinion
-----------------------------------
ok so im pretty good with the entire turing language and i want to learn a new one... i am new at programming tho as i just learned turing this year
Quite the hypocrite, indeed.
Maybe he just thinks he can master Turing and the basics of programming in a day? :lol:

-----------------------------------
paulkwatyra
Mon Nov 21, 2005 8:17 am


-----------------------------------
not in a day a few months im just getting bored with all the things we learn in skcool

-----------------------------------
ZeroPaladn
Mon Nov 21, 2005 9:53 am


-----------------------------------
ive been working at turing for 3 years now, and i havent even started learning about net with turing. if you think that you can learn an entire programming language in a few months then you got something coming for ya. take it easy, and learn new things, like cervantes said.

i will admit this is a neat game though.

-----------------------------------
paulkwatyra
Mon Nov 21, 2005 10:04 am


-----------------------------------
if it took you 3 years to learn turing u shouldnt be on this website

-----------------------------------
ZeroPaladn
Mon Nov 21, 2005 10:10 am


-----------------------------------
was that a flame? i sure hope it wasnt. either way, i took my time and didnt rush myself, mainly because i have the memory of a goldfish. Besides from the point, i know what i know today BY HEART because i took my time, and i think you should do the same.

-----------------------------------
paulkwatyra
Mon Nov 21, 2005 10:16 am


-----------------------------------
taking 3 years is a hell of a lot of time especially for a simple language like turing

-----------------------------------
Tony
Mon Nov 21, 2005 10:40 am


-----------------------------------
taking 3 years is a hell of a lot of time especially for a simple language like turing
You have one week to write a 3D Engine, and put together a demo. Go!

-----------------------------------
paulkwatyra
Mon Nov 21, 2005 11:44 am


-----------------------------------
ok who do i send it to?

-----------------------------------
Tony
Mon Nov 21, 2005 11:49 am


-----------------------------------
you post it up in [Turing SC]

-----------------------------------
MysticVegeta
Mon Nov 21, 2005 2:47 pm


-----------------------------------
ive been working at turing for 3 years now, and i havent even started learning about net with turing. if you think that you can learn an entire programming language in a few months then you got something coming for ya. take it easy, and learn new things, like cervantes said.

i will admit this is a neat game though.

Did you say 3 years? I found a January 2005 post by you called "My First Program"

http://www.compsci.ca/v2/viewtopic.php?t=9226
are you sure?

-----------------------------------
SnoopDuck
Mon Nov 21, 2005 3:27 pm


-----------------------------------
Whats with the fighting people..... Pauls just trying to get some help im in school with the guy and he's freally into his game making you don't gotta get all mad and stuff just point him in the right direction and chill.....

-----------------------------------
Cervantes
Mon Nov 21, 2005 3:51 pm


-----------------------------------
if it took you 3 years to learn turing u shouldnt be on this website
You're not one to say who should be on this site and who should not.  This website is open to anyone, provided they follow certain rules.

Whats with the fighting people..... Pauls just trying to get some help im in school with the guy and he's freally into his game making you don't gotta get all mad and stuff just point him in the right direction and chill.....
It's hard to know what direction to point him in when he reveals his current programming ability in riddles and contradictions.

-----------------------------------
SnoopDuck
Mon Nov 21, 2005 3:54 pm


-----------------------------------
Maybe to you but..... you can just say hey look up "this" and "this" and that should help you out..... He told you exacly what he needed all you gotta tell him is what he needs,

-----------------------------------
Dan
Mon Nov 21, 2005 5:11 pm


-----------------------------------
Maybe to you but..... you can just say hey look up "this" and "this" and that should help you out..... He told you exacly what he needed all you gotta tell him is what he needs,

Users here just do not like being liyed to. If you look at the 1st few posts there aucatly was some helpfull links posted. I whould ask that users drop the topic of the user progaming level and just assum what they side in this topic is ture.

-----------------------------------
paulkwatyra
Tue Nov 22, 2005 8:53 am


-----------------------------------
ok... i still dont get how to do networking in the game/???? your net tutorial is horrible it doesnt explain it all it is, is a source code i need to know how to do it.??? so still i need hellp ppl n snoopdog who r u????

-----------------------------------
Tony
Tue Nov 22, 2005 9:20 am


-----------------------------------
alright alright, lets take this a bit slower.. what don't you know how to do?

An approximate order of steps is as follows:


start a server
listen to connection
start a client
request connection to the server
connect to the server
have a server listen to the next connection (if required)
send data to the server about the state of game in each client
forward the data to every other active client
syncronize states between clients
(optional) validate

How far can you get in that list?

-----------------------------------
paulkwatyra
Tue Nov 22, 2005 9:51 am


-----------------------------------
start a server 
i have the computers connected with the network, the only thing is they arent sending information to each other. here look at this game i made it really simple to try and figure out how to do it.






const chatPort : int := 5055 
var choice : int 
var netStream : int 
var netAddress : string 

var chars,chars2:array char of boolean
var x,y,x2,y2:int
x := 250
y := 200
x2 := 400
y2 := 400

loop 
put "Enter 1 to run chat server" 
put "Enter 2 to run chat session" 
put "Choice: " .. 
get choice 
exit when choice = 1 or choice = 2 
end loop 



if choice = 1 then 
View.Update 
put "This machine is '", Net.LocalName, "' at net addresss ", Net.LocalAddress 
put "Waiting for a connection... " 
netStream := Net.WaitForConnection (chatPort, netAddress) 
View.Update 
else 
put "Enter the address to connect to: " .. 
get netAddress 
netStream := Net.OpenConnection (netAddress, chatPort) 
if netStream 