Make A Game Like Pokemon in Unity | #13 - Physical and Special Moves

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

nice

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/Badpythonbot πŸ“…οΈŽ︎ Jul 04 2020 πŸ—«︎ replies

If you're new to this series, here is the entire playlist.

Let me know in the comments what other feature you would like me to cover.

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/GameDevExperiments πŸ“…οΈŽ︎ Jul 04 2020 πŸ—«︎ replies

I've only gone about halfway through your series so far, but I'm greatly enjoying it. I've already learned a great deal that I can apply to my own personal project and have been looking forward to your updates. I'm glad to see that you've started a Patreon and am happy to contribute and support the series. Keep up the good work!

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/hreigle πŸ“…οΈŽ︎ Jul 04 2020 πŸ—«︎ replies

These are great! Thanks so much. I was wondering why you don't have the Battle System as a separate scene? If I remember correctly you had it in the same scene but just a different camera

That way you could pass parameters to the scene like enemyPokemon[], userPokemon[], arenaType etc, and also have scene transitions?

Just wondering, I have no idea which is the correct way to go about it lol

πŸ‘οΈŽ︎ 2 πŸ‘€οΈŽ︎ u/Ridwan232 πŸ“…οΈŽ︎ Jul 20 2020 πŸ—«︎ replies
Captions
hey everyone welcome to part 13 of the pokemon game series in unity in this video we'll implement physical and special moves so special thanks to alexander for the support in patreon and suggesting this topic for this video so if you think the series is helpful you can support me in making it by becoming a patreon and unlock some cool rewards for that so let's start this video so first let's look at what are special moves and physical moves so if you look at special move in bulbapedia special moves are moves belonging to these types so moves of types like fire water grass and all our special moves and physical modes are most of these types so we can easily find whether a move is physical or special based on its type so inside our move base class we'll create a new boolean property called is special and inside the getter we should return true or false based on the type of the move so if type is equal to pokemon type dot fire or water or grass so if the type of move is any of these then we'll return true indicating the move is special and otherwise we'll just return false indicating the move is physical so now in our pokemon class we should consider whether the move is physical or special while calculating the damage so right now we're just using the normal attack and defense for calculating the damage but we should only use this if the move is physical so if the move is special then we should use the special attack and special defense stat of the pokemon so here if the move is special then we should use the special attack of the attacker and otherwise i'll just use the normal attack and we'll store this into a float variable called attack so if you haven't used the conditional operator before it's just a shorter way of writing if else so if special is true then we will return special attack and otherwise we'll just return normal attack and for the defense if the move is special then we should return the special defense of the current pokemon and otherwise we should use the normal defense so now let's use these variables for calculation so now if we test the game we wouldn't see any difference but we will be using the special stat or the normal stat based on the type of the move so let's test that by debugging i'll just add a breakpoint here and attach this to unity and now if we test the game and try to start a battle so if i use scratch which is a physical move the execution just stopped here since we have a breakpoint and now we can just keep the mouse on any variable to see its value so if you look at is special it is false because scratch is actually a physical move and the value of special attack is nine and normal attack is eight but if you look at the value of attack it's eight which means we are using the normal attack value since our move is physical so if you haven't done debugging before i highly recommend you learn about it and start using it because it's one of the most useful tools for programmers we can easily check if a code is working correctly and also when we have some issues we can easily find that out so i'll just hit continue and we should go back to our game so bulbasaur used growl which is also a physical move it's actually a status move we haven't implemented status moves yet but we'll do that in a later video so now if i do ember which is a fire type you can see that is special is actually true now and the value of attack will be equal to the value of the special attack and same for the difference also so our logic is working correctly so i'll just remove the breakpoint and hit continue so there is one thing i missed while implementing the battles we should actually reduce the pp of the move when it is performed but we are not actually doing it right now so let's fix that i'll just stop debugging and inside the battle system when the player performs move we need to reduce the pp of the move so this will decrement the value of vp by one and let's also do that inside the enemy move and now if we test the game so right now scratch has 20 pp and if i use it once you can see that it's pp has been reduced to 19. so i'll stop the video here if you think this videos are helpful consider subscribing to my channel and leave a like on this video that'll really help me a lot so i'll see you in the next video
Info
Channel: Game Dev Experiments
Views: 5,283
Rating: undefined out of 5
Keywords: make a game like pokemon in unity, how to make a game like pokemon in unity, make pokemon in unity, make pokemon game in unity, how to make pokemon game in unity, make a pokemon game in unity, unity pokemon game tutorial, unity turn based battle system, turn based battle system in unity
Id: P1UMO887BtM
Channel Id: undefined
Length: 6min 57sec (417 seconds)
Published: Sat Jul 04 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.