Two players game [SOLVED]

I’m making a beat them up game for pc, I’ve already made it for one player and decided to add a player. What kind of operation it would be better to use?

  1. Group objects = changing object “Hero1” to group objects “Heroes” ( Hero1 + Hero2)
    (suppose it will not work correctly)
  2. Two instances of Hero1 (not sure if it can solve all the problems i can face)
  3. Make code separetely by copying Hero1 code changing to Hero2 (will work nice, but i think it will take twice as much resources)
    Who has any ideas?
  1. This won’t work properly unless you can uniquely identiy each player to apply the code to. Otherwise, if you reference Heroes, how does GDevelop know which one you mean?

  2. Nope. See second sentence in answer 1

Have a look at the GooseBomberMan and Multiplayer examples to see how those two have implemented it.

1 Like