• 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!

Can anyone help me figure out how to do character spawning for a character selection screen?

R

RagingWolf1109

Guest
I want to make a 2 player PVP combat game with multiple character options however I am having trouble figuring out how to allow players to pick their chosen character and then spawn them both into the battle room. Any ideas?
 
W

whale_cancer

Guest
You probably need 4 global variables:
global.player_1_character_choice
global.player_2_character_choice
global.player_1_ready
global.player_2_ready

When player 1 selects a player, set global.player_1_character_choice to a value that indicates that character. When player 2 selects a player, set global.player_2_character_choice to a value that indicates that character. Select here probably means that you merely have the character highlighted like in an old school fighter game (e.g. mortal kombat)

Then there should probably also be a ready variable. This would be flagged when a player commits to their character (e.g. press "A" or whatever if this were mortal kombat). Check every step so that once both players are ready, go to the combat room. Use the global.player_1_character_choice and global.player_2_character_choice to spawn the correct characters.

Just pseudocode, but this should be pretty simple.
 
Top