Game Development Community

Controlling several player objects

by Sylvain · in Technical Issues · 09/06/2007 (4:06 am) · 1 replies

Hi everyone !
I was wondering : is it possible in TGE (with or without engine modifications) to create 2 instances of player objects and control them simultaneously say with a joystick and the keyboard, or 2 joysticks ?

The issue is that in default.bind.cs the keys are bound to functions to modify global variables ($mvForwardAction and so on..) which are used in order to control the character's movement. So if I continue this reflection, i may say that I'd need to create a PlayerBis object (copying and pasting player.h and player.cc ... i mean, this can't be that straightforward, but you see the idea) with its own global movement variables, am I right ?

Or would an other option be to use an AIPlayer object and try to control it ? (it wouldn't be an "AI" anymore then !)

These are just speculations, since I haven't found any information on the subject !

If this proves to be unachievable, I have a plan B that simply consists in switching between 2 instances of player object and thus controling them one after the other ... which is easier ... but less fancy (i'm not sure this is a right adjective for script)!

Anyway, what do you think about that ? Have you heard of someone who achieved that ?

Thanks in advance !

#1
09/26/2007 (1:43 am)
I read somewhere that I'd need to "create several player connections with differents controls" ... It sounds great but i don't have a clue how to achieve that !
Any help would be grandly appreciated !
Thanks !