Python Pokemon - Python Class Tutorial for Beginners

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 ธ.ค. 2024

ความคิดเห็น • 172

  • @leonlysak4927
    @leonlysak4927 5 ปีที่แล้ว +62

    Hands down one of the best introductions to both classes and object oriented programming in Python.

  • @3sper_06
    @3sper_06 3 ปีที่แล้ว +14

    my brother is a huge pokemon fan and I am making this for his birthday coming up soon! Thanks so much!

  • @DeathxStrike18
    @DeathxStrike18 4 ปีที่แล้ว +2

    I know this is old and was just to teach basics, for the code for type advantages you didnt have to double/divide by 2 for both attack and defence essentially you ended up quadrupling the damge as the calculations were being done twice. You doubled the damage while taking armor where you could have just increased damge. For it to be super effective.

  • @RipeBagel
    @RipeBagel 10 หลายเดือนก่อน +1

    This was EXTREMELY helpful, couldn't have done it without this video!! Thank you so much!!

  • @prodbytoxik
    @prodbytoxik ปีที่แล้ว

    this is so much better than the CS50 version, you actually demonstrate while teaching.

  • @sdnmkhn
    @sdnmkhn 4 ปีที่แล้ว +4

    I was making something like this in Java for fun, and got stuck. This video rlly helped me, so thank you!

  • @NeoSmoove
    @NeoSmoove 2 ปีที่แล้ว +8

    Make more pokemon code tutorials and break them up to parts. Good video keep the clear, energetic, and short to the point style

  • @ElManny001
    @ElManny001 ปีที่แล้ว +1

    You sir deserves a medal 🏅 from all your viewers

  • @Pippintheboy
    @Pippintheboy 3 ปีที่แล้ว +1

    There were 50 digimons fans who did not like this video.
    Really great vid man can’t believe it hasn’t blown up even larger!!

    • @hunter7643
      @hunter7643 ปีที่แล้ว

      Lmao I’m using this to help me make a Digimon game 😂

  • @theteastoners5935
    @theteastoners5935 ปีที่แล้ว

    great tutorial
    a little bit fast for me (as a beginner) but after a pausing the video a few times i got the idea

  • @lunarrvxlive
    @lunarrvxlive 2 ปีที่แล้ว +2

    I was wondering if you had a way to import numpy, because for me it isn't working and it says I don't have it on my computer.

  • @amultitaskingperson
    @amultitaskingperson 3 ปีที่แล้ว

    This is perfect! I was never sure how to m ake a pokemon game in python but THIS GUY SHOWED ME!
    Thanks so much

  • @joshuaadeosun5709
    @joshuaadeosun5709 4 ปีที่แล้ว +5

    Hey. I'd like to know if there was a way to make pokemon 2 AI so you're battling against the computer. I tried using a random number generator to pick out moves for pokemon 2 but it didn't work. Do you know any tips that could help.

  • @theodorrausp6918
    @theodorrausp6918 4 ปีที่แล้ว +1

    Dude simply mind blowing!

  • @OmegaVibe
    @OmegaVibe 3 ปีที่แล้ว +5

    Thanks a bunch!
    This was really cool!

  • @Royastico
    @Royastico 4 ปีที่แล้ว +1

    If I wanted to add propoerties to the moves (type and damege) does the moves have to be objects too?

  • @emoticonmen
    @emoticonmen 3 ปีที่แล้ว +1

    Would this work on pycharm?

  • @chhaysing8075
    @chhaysing8075 4 ปีที่แล้ว +1

    f string single are not allowed??

  • @haihonglei6668
    @haihonglei6668 4 ปีที่แล้ว +1

    great information, but there is a line I don't quite get it: delay_print(string_1_attack)
    Seems string_1_attack is never defined, but only inside the if statement... and it's a local variable there...

    • @haihonglei6668
      @haihonglei6668 4 ปีที่แล้ว

      @@pythonmaraton ah I see, python doesn't require variable to be declared in advance

  • @gekidotempest784
    @gekidotempest784 4 ปีที่แล้ว +1

    Instead of bars, how would you use numbers as health instead? For example, if a charmander has 50 hp and lost 20 hp, i want it to show the numbers instead

  • @apexblodhunder
    @apexblodhunder 4 ปีที่แล้ว +2

    can you help me? I followed your instructions and when I ran the code I got hit with a "No module named 'numpy' " Does anyone know how to fix this?

    • @Acradus
      @Acradus 2 ปีที่แล้ว

      @@pythonmaraton hello, i get an error - bash: pip: command not found
      I’m using pycharm

  • @Loomisheep
    @Loomisheep 4 ปีที่แล้ว +2

    I have a project in class and I was like "yeah let's do that"

  • @hmbackup6577
    @hmbackup6577 2 ปีที่แล้ว

    As a Pokémon fan and Python fan, I just had the BIGGEST nerdgasm

  • @brodiepasker9918
    @brodiepasker9918 3 ปีที่แล้ว

    I'm definitely gonna take this and add all the pokemkb

  • @helloNotato
    @helloNotato 3 ปีที่แล้ว +6

    Fantastic tutorial, appreciate the work you put in!
    I would actually appreciate it more if it had less repetitive memes though lol

  • @ronin7561
    @ronin7561 2 ปีที่แล้ว

    This is essentially Pokemon Crater :o

  • @flopaflop420
    @flopaflop420 4 ปีที่แล้ว +2

    hello! i have a problem, it says that local variable 'string_1_attack' referenced before assignment

    • @flyinglack
      @flyinglack 4 ปีที่แล้ว

      make sure to only use the variables AFTER you create it.

  • @haihonglei8851
    @haihonglei8851 4 ปีที่แล้ว +1

    may I ask what the enumerate() is for?

  • @mikkenix5698
    @mikkenix5698 3 ปีที่แล้ว

    I've defined 'fight', but it aint working. 'Pokemon' object has no attribute 'fight'

  • @lookatmepleasesir
    @lookatmepleasesir 2 ปีที่แล้ว +2

    would be better without the music and especially without all the asinine interruptions with video clips

  • @flame7495
    @flame7495 4 ปีที่แล้ว

    if at the begining import numpy as np if numpy had an error then you need to install the pakage

  • @TuxHouseEdu
    @TuxHouseEdu 4 ปีที่แล้ว +1

    Very cool video!!

  • @foxcannon4512
    @foxcannon4512 3 ปีที่แล้ว +1

    Question? i have the same code you do i even at the end i downloaded yours but i cant type what move i want to use plz help :)

  • @KayaMehmet-h9e
    @KayaMehmet-h9e 2 ปีที่แล้ว

    Does anyone know how u could add this to a pygame display/window that has a type of interface?

  • @ericwalsworth9740
    @ericwalsworth9740 3 ปีที่แล้ว

    I don’t have atom but I have vscode will it still work in vscode

  • @jamesr4369
    @jamesr4369 3 ปีที่แล้ว

    how do i make then random ther only Charizard
    Blastoise and how do I restart the game?

  • @shubhamjain5353
    @shubhamjain5353 3 ปีที่แล้ว

    You earned a subscriber ❤️

  • @AllRounderAdi
    @AllRounderAdi 4 ปีที่แล้ว

    its telling moves is not defined and i did exactly what u did even at the end when u got the error i did the same thing but it still shows moves is not defined can you help?

  • @frogs3338
    @frogs3338 7 หลายเดือนก่อน

    Saving for myself 10:52

  • @carminedominicus3732
    @carminedominicus3732 4 ปีที่แล้ว

    For some reason when I type
    Class Pokemon:
    Pokemon does not seem to get defined as a class. When running in terminal I have this error message:
    File

  • @iagodecarvalho3055
    @iagodecarvalho3055 5 ปีที่แล้ว +4

    This tutorial is awesome! Thank you!

  • @deadheadtv6612
    @deadheadtv6612 ปีที่แล้ว

    Could you please make another tutorial on how to make a character selection screen?

  • @mythiccc4724
    @mythiccc4724 2 ปีที่แล้ว

    How can I make it so you can choose your pokemon

  • @techxball
    @techxball 2 ปีที่แล้ว

    I keep getting this error but I'm confused as the code is identical "f-string expression part cannot include a backslash" could you please advise??

  • @lilhajime2681
    @lilhajime2681 4 ปีที่แล้ว

    for some reason it says that theres a invalid litetal for int() with base 10: and then a move i picked, how do i fix it?

  • @dateddielol
    @dateddielol 5 ปีที่แล้ว +12

    I'm having difficulty with some indentation errors after going through it line by line. Is there any chance you could provide a link with your code for me to play around with?
    Thanks for the tutorial!

    • @trolmaso
      @trolmaso 4 ปีที่แล้ว +1

      There’s one in the description

  • @toshi2867
    @toshi2867 3 ปีที่แล้ว

    I have a question why does it say that there is nothing called numpy

  • @sammyz4673
    @sammyz4673 4 ปีที่แล้ว +2

    I am still a semi beginner at python and this is an amazing video but when I ran my code it said 'Pokemon' does not have attribute 'fight' how can I fix this???

  • @vinhtran6533
    @vinhtran6533 4 ปีที่แล้ว +1

    Can I use this to create a game for my assignment task? I’ll follow the guide on character creating or object but it's not a Pokemon game.Is this only viable and work for Pokemon game?

  • @AdilsonVCasula
    @AdilsonVCasula 3 ปีที่แล้ว

    Is it possible to call Pokemon names from the class? I'm trying to add a "choose your and opponent" pokemon input

  • @bryanhoangbach2255
    @bryanhoangbach2255 20 วันที่ผ่านมา

    10:52 It keeps saying there's an error in the code. I typed:
    while (self.bars > 0) and (Pokemon2.bars > 0):
    print(f"{self.name}\t\tHLT\t{self.health}")
    print(f"{Pokemon2.name}\t\tHLT\t{Pokemon2.health}
    ")
    It says there's an error in self.bars, self.name, self.health, Pokemon2.name, Pokemon2.health.
    P.S. I use PyCharm.

    • @pythonmaraton
      @pythonmaraton  20 วันที่ผ่านมา

      Hmmm make sure the tabs and spacing are all correct. If all else fails you can download the code by following the link in the description.

    • @bryanhoangbach2255
      @bryanhoangbach2255 18 วันที่ผ่านมา

      @@pythonmaraton Thanks!

    • @bryanhoangbach2255
      @bryanhoangbach2255 18 วันที่ผ่านมา

      @@pythonmaraton Btw where's the link?

  • @leafwingking7310
    @leafwingking7310 2 ปีที่แล้ว

    Hey! I tried the code, but I'm having a problem with the code not reading string_1/2_attack. How do I fix this?

  • @bod2796
    @bod2796 3 ปีที่แล้ว

    I keep getting the same error where when I try to run the code in Terminal I get a syntax error near unexpected token `in'

  • @w3rw507
    @w3rw507 4 ปีที่แล้ว +1

    Hey, great Video and good to understand but I got one problem here and that is none of my programs I use for Python (Atom included) know 'numpy' got any solution for that?

  • @gino7331
    @gino7331 3 ปีที่แล้ว

    i run the code but it say no module named num

  • @idheeruramcreations3639
    @idheeruramcreations3639 4 ปีที่แล้ว

    can you tell how to add more types

  • @lrsundarapandi
    @lrsundarapandi 4 ปีที่แล้ว

    Which program are you can u plz tell

  • @yaiserable
    @yaiserable 4 ปีที่แล้ว

    What pyhon version are you running?

  • @benjaminzimmer7378
    @benjaminzimmer7378 7 หลายเดือนก่อน

    Where did you enter the code for the .fight? cant see it anywhere?

    • @pythonmaraton
      @pythonmaraton  3 หลายเดือนก่อน

      It’s the giant function that starts on line 27

  • @SunnyGame04
    @SunnyGame04 ปีที่แล้ว

    Hello i need HELP PLS i have look your video but i dont know how do it can y write per PN ? i need more help pls about discord ore what

  • @marcelomoraes1341
    @marcelomoraes1341 4 ปีที่แล้ว +1

    That was amazing! Thank you so much!!!

  • @Megabyte1
    @Megabyte1 2 ปีที่แล้ว

    Thank you this helped me so much!

  • @softballnims9
    @softballnims9 4 ปีที่แล้ว

    On line 56 when you said version[(i + 1) %3], why do you need to use %3? What would happen if you didn't use it?

  • @tanishbhajnik4822
    @tanishbhajnik4822 3 ปีที่แล้ว

    Great Work!!!

  • @windyyeu7426
    @windyyeu7426 5 ปีที่แล้ว +1

    what does numpy do?

    • @windyyeu7426
      @windyyeu7426 5 ปีที่แล้ว

      @@pythonmaraton thanks

  • @adrymateoramon7087
    @adrymateoramon7087 3 ปีที่แล้ว

    Amazing video❤️❤️❤️❤️

  • @factsnhien
    @factsnhien 3 ปีที่แล้ว

    do we need to download sprite ????????????????????????

  • @bork7430
    @bork7430 4 ปีที่แล้ว

    What do you use to run the script?

  • @Schnitzeldawg
    @Schnitzeldawg 4 ปีที่แล้ว

    Do you think this would be possible to recreate this, but in AppleScript?

  • @somalu-yw1mf
    @somalu-yw1mf 3 ปีที่แล้ว

    Can i use VISUAL STUDIO CODE to do the project?

  • @cs051rajeshwaranv3
    @cs051rajeshwaranv3 4 ปีที่แล้ว

    Can this program run in pycharm

  • @gabrielrosalesgabrielonix7630
    @gabrielrosalesgabrielonix7630 5 ปีที่แล้ว +1

    Omg you are awesome !!

  • @frogs3338
    @frogs3338 7 หลายเดือนก่อน

    Saving for myself: (10:52)

  • @mystik4957
    @mystik4957 4 ปีที่แล้ว

    do you have to use 2 variables in the for loop or can you do it with 1? in the types and the fighting

    • @mystik4957
      @mystik4957 4 ปีที่แล้ว

      @@pythonmaraton my terminal is giving an error string_1_attack not defined even though I've already defined it.
      it gives unbound local error

  • @nshmrakki
    @nshmrakki 4 ปีที่แล้ว

    it says that numpy doesent work....
    im using 3.8 so how can i do it on that version?

    • @nshmrakki
      @nshmrakki 4 ปีที่แล้ว

      @@pythonmaraton those commands dont work for some reason

    • @nshmrakki
      @nshmrakki 4 ปีที่แล้ว

      @@pythonmaraton windows

    • @nshmrakki
      @nshmrakki 4 ปีที่แล้ว

      @@pythonmaraton thank you it worked!

  • @johnniewhipp5
    @johnniewhipp5 3 ปีที่แล้ว

    Did you use pygame to code this?

  • @jhonpuddingham1237
    @jhonpuddingham1237 4 ปีที่แล้ว +1

    Is there any way you can incorporate move typings into the game? If so how? I am trying to make a game for my friend who really likes pokemon. :)

    • @miguelpalencia9788
      @miguelpalencia9788 4 ปีที่แล้ว

      Do you make them for profit ? I’m trying to make one but I don’t know how to Im willing to pay

    • @Acradus
      @Acradus 2 ปีที่แล้ว

      Did you ever figure this out? My guess would be to make moves into a class, and the movelist would be a class instead of a string?
      But I’m literally beyond beginner, I’m clueless

  • @siddheshasharma928
    @siddheshasharma928 4 ปีที่แล้ว

    Syntax error is coming in 17th line as I am working on collab is there a prob bcz of it plz tell ?

  • @angelqwq9764
    @angelqwq9764 3 ปีที่แล้ว

    Please help me it keeps giving me a syntax error. I'm using Python Idle btw

  • @RainbowApe-dg7ez
    @RainbowApe-dg7ez 4 ปีที่แล้ว

    this tutorial is amazing!!! thx so much

  • @advithikothapalli5961
    @advithikothapalli5961 2 ปีที่แล้ว

    Great Video!!! I followed your tutorial, however I would like to make a change, and I need help on how. I would like to make is so that the viewer can choose their opponent (Either venasaur or blastoise), and depending on that, the pokemon chosen will be their opponent. Do you know how I can impliment this??

    • @jamesdo7387
      @jamesdo7387 2 ปีที่แล้ว

      To keep it simple I’d use input() with an If, Elif block.
      player_choice = Input(“Type which Pokémon you’d like to fight:
      ”)
      If player_choice == “Squirtle”:
      .
      .
      .
      Elif player_choice == “Charmander”:
      .
      .
      .
      Elif player_choice == “pikachu”:
      .
      .
      .
      What’s in the control flow will vary depending on how the previous code looks.

  • @rohiniindulal7050
    @rohiniindulal7050 4 ปีที่แล้ว

    I'm new to python...{using sublime text 3}
    wen i type :
    import numpy as np
    it shows(wen i try to build it } :
    import numpy as np
    ModuleNotFoundError: No module named 'numpy'
    PLS HELP URGENT...
    THANK U

    • @johndraws3184
      @johndraws3184 4 ปีที่แล้ว

      @@pythonmaraton i too have issues with the numpy when you anaconda terminal what do you mean by that? cause i am on a mac i used normal terminal on my mac and it didn't work.

    • @johndraws3184
      @johndraws3184 4 ปีที่แล้ว

      @@pythonmaraton i was able to fix it thanks for answering me back though.

  • @loopycontent6489
    @loopycontent6489 4 ปีที่แล้ว

    I get an error for "import numpy as np"

  • @SeiferVIIIGaming
    @SeiferVIIIGaming 4 ปีที่แล้ว

    Master class

  • @gianfrancoperezarica7825
    @gianfrancoperezarica7825 4 ปีที่แล้ว

    No module named 'numpy' I have this error help its in line 2 I downloaded your code

    • @alexanderislas4382
      @alexanderislas4382 4 ปีที่แล้ว

      If you didn't catch it, try to run pip install numpy in the terminal

  • @thetamilselvan7562
    @thetamilselvan7562 4 ปีที่แล้ว

    I can't see this code can you send code in comment section please

  • @ashleamo3981
    @ashleamo3981 4 ปีที่แล้ว

    what program do you use

    • @ashleamo3981
      @ashleamo3981 4 ปีที่แล้ว

      Rylan Fowers yo thanks for the reply bru

  • @manavplayz9283
    @manavplayz9283 4 ปีที่แล้ว

    what python is that

  • @LtCau_
    @LtCau_ 4 ปีที่แล้ว

    Can I use Sublime Text 3 for this

    • @LtCau_
      @LtCau_ 4 ปีที่แล้ว

      @@pythonmaraton I am having a problem when i press pip3 install numpy in my command prompt it doesn't work

    • @LtCau_
      @LtCau_ 4 ปีที่แล้ว

      @@pythonmaraton That also didn't work

    • @LtCau_
      @LtCau_ 4 ปีที่แล้ว

      @@pythonmaraton Dont worry i reinstalled python and that fixed the problem

  • @alexguan9130
    @alexguan9130 4 ปีที่แล้ว

    should it be sound?

  • @spencermarshall8949
    @spencermarshall8949 4 ปีที่แล้ว

    Mine says
    Charizard = Pokemon(‘Charizard’, ‘fire’, [‘Flamethrower’, ‘Fly’, ‘Blast Burn’, ‘Fire Punch’], {‘ATTACK’:12, ‘DEFENSE’: 8})
    TypeError: Pokemon() takes no arguments
    ??

  • @MrBonk-vp9vm
    @MrBonk-vp9vm 4 ปีที่แล้ว

    If ur new dont worry its very hard to introduce people to python

  • @felipedavid6381
    @felipedavid6381 5 ปีที่แล้ว

    wow, awesome tutorial !

  • @Laflamablanca969
    @Laflamablanca969 4 ปีที่แล้ว

    Brahh learnt to use classes

  • @bretkitchin5212
    @bretkitchin5212 4 ปีที่แล้ว

    im having trouble with "numpy" can you help me out?

  • @thataquaguy
    @thataquaguy 4 ปีที่แล้ว

    Python 3.9?

  • @Aditya-ll1zq
    @Aditya-ll1zq 21 วันที่ผ่านมา

    bro this is tough

  • @coding10yearold
    @coding10yearold 3 ปีที่แล้ว

    awesome awesome job and thank you. this will help me make my first own game.
    is it odd for me to change the "Determine damage" code to the following?
    # Determine damage
    self_attack = self.attack - int(0.1*Pokemon2.defense)
    Pokemon2.bars -= self_attack
    Pokemon2.health = ""
    # Add back bar plus defense boost
    for j in range(int(Pokemon2.bars)):
    Pokemon2.health += "="
    I put self underbar attack so it doesn't overwrite self.attack
    the int() function in range is probably 200% redundant I am guessing

  • @veotic2728
    @veotic2728 4 ปีที่แล้ว

    Good video!