Jump to content

Planning on creating a Puzzle/Platformer game

Hi, I'm planning on creating a puzzle/platformer game that has different controllable characters (press 1 for one char, press 2 for another, etc), but only uses the same movement control (WASD + Space for jumping). How can I approach this? Please take note I'll only be using Visual Studio XNA with Monogame (no other engines)

 

Here's my current options:

- creating the multiple characters as different objects and calling them upon press of the button

- creating movement control as an object and use it for all of the characters on the Update stage

 

Additional question: How do I make the camera movement smooth between transitions of the 2 characters? 

 

Spoiler

 

Link to comment
Share on other sites

Link to post
Share on other sites

Assuming you're asking for help in switching characters, I'll give 2 options. 

 

Pretend you understand C for a second

 

While(playing){

   While (player1){

      Jump =1;

      Power = 5;

   }

   While (player2){

      Jump = 5;

      Power = 1;

   }

}

 

(no code blocks on mobile that I can see)

 

Or do functions 

 

Updates every second{

if key press 1

    Change to 1

else if key press 2

    Change to 2

}

change to 1 function{

   Power= 5;

}

changr to 2 function{

   Power = 7

}

 

finally yiu you can actually swap out characters instead of changing stats.

 

Updates every second{

if key press 1

    Change to 1

else if key press 2

    Change to 2

}

change to 1 function{

   Find player position

   Delete player

   Create player version 1 at position

}

changr to 2 function{

   Find player position

   Delete player 

   Create player version 2 at position

}

 

^^ that may not work depending on how you program lose conditions and AI. Otherwise you may need more function calls. 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×