Page 1 of 1

Player position and other questions

Posted: June 8th, 2011, 11:50 am
by boi
I'm a teacher and currently looking at PAS for next term lesseons.
Last week a couple of kids and myself made our fist steps in PAS and had a lot of fun with coop-editing a map.

Our next step would be to create some player interaction in-game.
We decided that we will go for some very simple hide-and-seek action.

We made a programm-overview, it looks like this:

1. One Player triggers an event (e.g.: moves to a start location).
He/she will be the "catcher".

2. After 30sec. (or so) he tries to find and catch all the other players.

3. When all player are found the game restarts.

After a good look at the PAS-wiki and the sauerbraten/cube2-pages I am still unable to answer the following Questions:

1. How can we store player-data? Variables like "catcher=0" for each player are necessary to code because e.g. only the catcher should be able to "catch".

2. How to implement the catching?
We thought about comparing the position of the players (e.g. posPlayer=x,y,z; if posCatcher=posPlayer then playerStatus...).
Is there a function for "getPosition"? Or an other way to detect collision between players?

I am looking forward for any suggestions, please excuse my bad engish.

PS: Linux, PAS V2.6.1

Re: Player position and other questions

Posted: June 11th, 2011, 3:50 pm
by Runescapedj
I'm not good at coding, so I don't know the answer, but I'll just reply to get it back at top, so more people'll see it, because I think this has to be possible.

Please reply!