0 votes

So, I am trying to build a first project which is a top down shooter.
I wanted it to have a single or 2 player mode and to be able to be played on pc and with controlers (so I can learn all these aspects through the jorney).

In this way I thought in creating only 1 player scene, instantiate this scene either as a player, enemies or player 1 and player 2.

I then thought of having an input control scene responsible to gather the inputs for each player and then, depending on game mode and the players instantiates, attach the control scene to each one accordingly.

I thought this would be a way to garantee scalability and guarantee against changes on controls, number of players etc.

The problem I am facing is that some of the controls and functions like collide_info do not differentiate between instantiated "player" nodes, and treat player one, player two or enemies all as "player". Also, this is getting me headaches to control the inputs and checks since everything depends on being instantiated and checked at the right time.

So what is the best way to design something like that either in terms of code or designing the node structure of the project?

Should I create a "player Scene" for each type of player? (player 1, player 2, enemies all have different "player scenes"?)
Is that a way to circunvate the problem of functions identifying the instaces as if they were the same?

Any documentation that could help here?

Thanks

Godot version 3.0
in Engine by (19 points)

1 Answer

0 votes
Best answer

So basically, you want multiplayer in Godot(at least I think that is what you want to do with 2 player mode). Here is some tutorials:
https://heroiclabs.com/blog/tutorials/godot-fishgame/

https://docs.godotengine.org/en/stable/tutorials/networking/high_level_multiplayer.html

by (76 points)
selected by
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.