 Okay, I've got about 10 minutes so my wife gets home with the kids and it'll be too noise to record any videos then So let's get this done. This video is part of a series on 2D game design If you haven't watched previous videos be sure to check out the playlist in the description of this video So far we have a very simple game with two players That move around the screen and you can jump and they collide with each other and with the bricks on the ground Now if you see I can jump or move left and right you can see that they move Identically let's give our players some custom values and there's different ways to do this I'm gonna try to keep it as simple as possible for you guys so we have our create player function here and we are The only variables that we're passing to it the only parameters are the x and y but we can pass other things Let's add another one here, and we'll call it j for jump And what we'll do here is we'll add to this function. We'll say the player dot jump So we're just creating this value here. We're gonna say equals j. Okay, so now Let's go up here and Add to where we create our players and give them different values. So I'm going to say comma and I Don't remember what values. Let's go 300. I think negative 300 because we want the moving up the screen comma negative 300 Well, let's give them different values. It's kind of the point So we're passing that now again as I mentioned and I'm kind of skipping over this just for simplicity reasons you really should do checks inside this function say Is x defined is y defined is j defined if not either completely x that of the function and cancel it or Set default values. We're not gonna do that right now And because I don't have time before the wife and kids get home Okay, so now we go to our player update function and here we have the jump function When you press up arrow and the player is touching something with its feet here instead of negative 350 what we can do is we can go P for that player dot jump and Now we're replacing that value with the value that we set when we created that player So now Save that refresh Let them both fall to ground if I press up. Ah You see one jumps higher than the other Look at that So now coming back over to our code Let's go back up where we're calling those we can create as many players as we want with different values for this So let me make this one 500. Let me make that might be kind of high, but we'll say 500 and we'll make this one 350 which was our original value save that f11 and Jump and now They can jump like this and I can have one jump on the other one's head now They both have left and right, but I can block him on the wall there and now Just like that Now they still move left and right the same so we can give them other values that we can change So let's go ahead come up here and just when you're doing this just try to make you know Your values something that isn't already defined. So real quick. We'll say player dot I'll just call it V for velocity and we'll set that to V So that players velocity will be whatever we set in V here And now we can come down here for left and right and I can say here negative player V and Here player dot V and of course we have to set those values when we create our players So I'm going to come up here create player comma, we'll say 150 comma and we'll say 200 so now if I did all that properly I should be able to refresh this and we can see Something locked up f12 Player not defined. Okay. That's because I said player instead of P down here And that's my fault for not being consistent with how I'm labeling stuff Because in this function play each player is called P because I just didn't want to play around each time Now let's try there we go now look at the player on the right It's moving faster than the player on the left. You can see he's gaining on him So there you can give each player Their own values when they're created and this is just one way of doing this That's it for this video. This is part of a series. I hope you're enjoying this series If you are think about becoming a supporter over at patreon.com. It's patreon.com forward slash metal x1000 And if you do become a supporter you get videos early because if you look at the playlist now You may not be able to see next week's video But if you are a supporter in the category for early releases you get all the videos at the beginning of the month and You can download them and watch them and and all that good stuff if you can't support me financially But you like my videos be sure to like subscribe Comment and share that's not only lets me know that you like this topic But it also helps spread my videos and gets me more viewers and I do appreciate that as always I thank you for watching and I hope you visit my website films by Chris comm that's Chris the cater Should be a link to that in the description as well. The wife just pulled on the driveway as always I hope that you have a great day