• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Local Co op Not Split Screen

T2008

Member
I've thought about adding a local co op mode way down the line after I'm done with the main game I'm making. I would like the players to be on the same screen and not split screen. I was wondering if there are any tutorials out there that show how to do this. There doesn't seem to be much out there. Also, is this something that can be added easily later on or do I have to think about it from the start. Any insight would be greatly appreciated!
 

kburkhart84

Firehammer Games
It is something I recommend you think about from the start generally. If you do, it lets you do things in easier ways. For example, your player object could have a variable ahead of time that says which player it is, which then says which inputs it looks up.

That said, there may not be tutorials for this because it really isn't anything special. It is really just about having duplicate variables for the status of the second player(like score and health and whatever else applies to your game). And you need a second object(or a 2nd instance of the same object that uses different inputs). Besides that, there isn't much special. You may need a few extra things for making sure the camera follow both players and maybe add code that stops the players from separating, again, whatever is appropriate for your game.
 

T2008

Member
Thanks! That's very helpful to know. As far as inputs, is there something about controller inputs and that sort of thing? Also, do you know of a good tutorial about camera following two players?
 

kburkhart84

Firehammer Games
As far as inputs, I sell an input system that takes care of all the dirty work of configuration and gamepad support. Whether you get mine or do your own, the best way to go about it is to make input a separate thing from the player objects completely. The player should never have to know about input and only check if it should jump or not. And the input system would check whatever key or gamepad input is assigned to that jump action and set the jump variable to true or false. That whole thing is what my input system does(among plenty of other things as well).

As far as tutorials about camera following players, I don't know of any. You can probably google it and find something though as that seems to be a common enough thing. You can probably find tutorials about gamepad support and such as well the same way.
 
Top