Let's Make Chess in Java!

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ม.ค. 2025

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

  • @oenwilson2486
    @oenwilson2486 3 ปีที่แล้ว +23

    This is a very interesting way to teach programming and we REALLY need a lot of this stuff on TH-cam. I appreciate this a lot!!

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

    I'm so glad that I found you. I've watched many videos of programming but I usually end up tired of narration which doesn't happen with your materials. Thank you so much!

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

    I love you! Your last speech was so motivational and it means a lot to me!
    I'm a 23 yo romanian male that have studied Pascal language in middle school and at the same time I was playing around with Milkshape 3D for modeling just out of passion for an Half-Life mod called ESF that was fan made and needed help so I offered myself.
    Soon after that I jumped right into C++. Python wasn't a thing back then and Java wasn't as popular as C++ (and maybe still isn't). It was a turnoff at first because of its complexity compared to Pascal but after a few months decided to start learning it again and even bought a book C++ For Dummies. It helped me understand the basics (never finished it).
    I started creating my own fun console projects like text based adventure games or RPGs and even "birthday gifts" that ask for the respective person's credentials as input so they can unlock an ASCII bunny or something like that.
    I only finished high school but never passed the final exam though. For 4-5 years I'm struggling working at shitty jobs that I dislike and getting bad salary and for a few months I'm seriously considering making my own games because I have no chance of getting myself hired with no university diplomas or stuff like that.
    Who knows, maybe I will eventually start my own carries as a CEO in the long run but for now I have to work hard and learn a lot and "put it on paper" instead of just thinking about it and you really pumped me up! I'm really grateful for that!
    And that's why I love you! (liked, subscribed, belled, added to favorites)

  • @Blalumamann
    @Blalumamann 8 ปีที่แล้ว +5

    @7:18 Maybe you figured that out yourself by now but if you are not happy with intellij placing the braces at the end of the line you can always change that behavior in setting->editor->code style->java->wrapping and braces->braces placement from "end of the line" to "next line if wrapped" to make it feel more c++ like

  • @MrStickmanPro1
    @MrStickmanPro1 8 ปีที่แล้ว +16

    You can change where IntelliJ puts the brackets... Settings > Editor > Code Style
    Just in case ^^

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

    this the first time i saw a very neat and organized project files 😂

  • @12kenbutsuri
    @12kenbutsuri 3 ปีที่แล้ว +2

    I dont usually comment my c codes, but I make the style and names very clear, and if not clear document it, I still can go back to a 3 year old project and start working on it in 5 min.

  • @RameenFallschirmjager
    @RameenFallschirmjager 5 ปีที่แล้ว +8

    the lady of computer kingdom! I must confess this is the first time I've seen a video about programming produced by a lady and I must say it's one the the best! we need more ladies on board already!

    • @guts-7210
      @guts-7210 3 ปีที่แล้ว +1

      okay calm down it's just a woman

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

      @@guts-7210 they are indeed rare species for people who don't leave the basement.

  • @anibalinds
    @anibalinds 7 ปีที่แล้ว +139

    "Let's make" not "i'll show u my game finished" xD, but interesting code

  • @pokeybit
    @pokeybit 8 ปีที่แล้ว +387

    Knock knock
    Who's there?
    [Really long pause]
    Java

    • @aomimezura11
      @aomimezura11 7 ปีที่แล้ว +68

      Me: Knock knock
      C: Who's there?
      Me: Unterminated string
      C: Unterminated string, who? R!*@()*% i1uwn12fou!897 avhejfaA#E$ARTWYWRDViu10009_)*)(*&(70-9)897*57jloiuwe
      *segmentation fault*
      I know it's been 7 months, but seriously, it's funny

    • @novnod
      @novnod 7 ปีที่แล้ว +27

      Replaced Java with Python and then I found it pretty funny.

    • @karollasocki7065
      @karollasocki7065 6 ปีที่แล้ว +21

      Knock knock
      Who's there?
      C++
      Knock knock
      Who's th-
      ASSEMBLER!!!

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

      @@aomimezura11 its been 2 years and i still havent laughed

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

      @@lokibalboa789 Um... Sorry?

  • @TheGuardian163
    @TheGuardian163 8 ปีที่แล้ว +17

    Yes, we missed your drawings! By the way you have a nice, clear voice.

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

    Wow , I just want to say , after watching a few of your videos , you can really well explain stuff in basic terms and are very helpful . You've earned yourself a sub

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

    Good video.
    Just want to add:
    way1) you could have "type" and getType defined in base (abstract) Piece class. And only thing required from the child class (like Bishop) would be to assign value to that type in own constructor (that is what you already do actually); so getType would not be abstract, and would just return this.type;
    way2) you don't need "type" member at all, just define abstract getType method and class like Bishop only return its own type (not stored anywhere) (that is what you actually return, don't know why you need "type" at all, since it only gets assigned, never read or its just me).
    P.S.: anyway, i must admit, you did great classes separation, which makes code easy to follow. Keep up good work!

  • @InfiniteUniverse88
    @InfiniteUniverse88 8 ปีที่แล้ว

    Part of the definition of a piece in this video is that a piece can be captured. Yet, a king cannot be captured.

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

    I havent even see the video but i love so much your voice, i was thinking about making a chess in c++, so this will help to make some contrast thank you so much

  • @Boxcow45
    @Boxcow45 9 ปีที่แล้ว +9

    Thanks for letting us take a look at your code, its really helpful for conceptualizing the inner workings of the game. I think I'll start making Connect Four first, however. :p

  • @supercool.avinash3
    @supercool.avinash3 3 ปีที่แล้ว

    This video can be related to anything but the demonstration of a real chess problem.

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

    Watches this video to refamiliarize myself with Object Oriented Programming concepts after a long break from coding- thanks!

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

    The biggest advantages of using Intellij IDEA, in my opinion, are the useful shortcuts - hotkeys, autocompletion, etc., and the Quick Actions.

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

    Woww amazing you are so young but so experienced. Great job! Me personaly i don't know much about coding but the few things i know are quite braincrushing for me but you - you just talk things straight with such an easy that is impressive. You earned my respect and my subscription (if that is an actual word nevermind i subscribed)

  • @nikoyochum6974
    @nikoyochum6974 6 ปีที่แล้ว

    Great video! Another design choice that I noticed at the 8:00 minute mark was that the board array of the board is a public variable. I am super anal about making all of my classes black boxes and only accessing those variables through properties (in C#) or get and set methods (in Java).
    It’s also a great example of a choice that isn’t necessarily wrong, it just has different benefits.

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

      you are super what about making all ur classes boxes ?

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

      @@denifrasheri8114 en.m.wikipedia.org/wiki/Anal_retentiveness

  • @Narblo
    @Narblo 6 ปีที่แล้ว +7

    I thought it was "let's make cheese in java!" hahaha damn i'm hungry

  • @leandro.marquesn
    @leandro.marquesn 8 ปีที่แล้ว +6

    I couldn't find this code in GITHUB. Could you paste the link to the code, please?

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

    Wow your channel is awesome! :D Thanks for this great videos

  • @mrthomaffy4658
    @mrthomaffy4658 8 ปีที่แล้ว

    You have earned yourself a subscriber and a like.

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

    @3:10 Zergling?...time to go 2 gate pressure, build 3 zealots and bring a probe.
    PS, in my chess experiments i like to make Move its own object. Every Piece has its own list of Moves. That way you can generate all Moves for all players on any turn, no matter whose turn it is, and then very easily detect which squares are under attack. This also makes it super easy to detect check/checkmate, and also illegal moves that put/leave the king in check.
    PS, i never use inheritance. I use enums (or chars) for piece type. So in a function like pce_generate_mves i have a thing like if (type == 'P') scr_generate_mves_pawn(); else if (type == 'N') scr_generate_mves_knight(); etc. I've heard polymorphism makes it a nightmare to figure out ownership of variables and methods and messing up badly. I think my way is way more simpler and easier to understand, maintain, debug, etc.

  • @ptidus1
    @ptidus1 9 ปีที่แล้ว +11

    Hi HappieCat, I love these videos, it's really great to see someone so eager to share knowledge, and you seem really enthusiastic to create game dev vocations, and that's cool too!
    One thing I noticed in your code is that you don't set a visibility to your member fields, letting them be used by the whole package. Is it something that you always do, or is it just because it's a small project and you didn't want to go overkill?
    It surprises me because I've always been told to set member fields to private and having getters/setters for the tiniest thing, and the more I talk with experienced programmers, the more I notice that this rule is rarely employed, so I wanted to know what's your stance on it. :)

    • @TheHappieCat
      @TheHappieCat  9 ปีที่แล้ว +10

      ptidus1 Nope, that's a good point! There were definitely some things I should have made private.

    • @vivantstudiosi
      @vivantstudiosi 8 ปีที่แล้ว +5

      As a professional programmer for more than 8 years already, I have to say that the visibility is just a means of protection to not to mess with data that you don't want to mess. Personally, I would only add a getter/setter if I need to use some sort of logic (for example, not changing the value if it is less than 10) or set some specific visibility, even though many people would say that it is not a good practice. :D
      What I would not do is to set a public getter and setter that just do an assignation on a private variable instead of making the variable public.
      Some standards like the JavaBeans standard tell you to create getters/setters for everything, but that is for another reason.
      Hope I explained myself properly :D

    • @rameynoodles152
      @rameynoodles152 7 ปีที่แล้ว

      +Studiosi
      That's my views on it too. I see no point in getters and setters that simply assign a value to a private variable. It really makes it no more secure since you can still access that variable freely through the getters and setters. Now it makes sense if you want to check the input before assignment, or if you only want to allow getting or setting but not both.

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

      @@rameynoodles152 if it's a reference variable though, using getters and setters are vital. otherwise you could mess up the references

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

      @@himani8927 That's not possible, at least with C++. References are only bound to a variable at declaration and cannot be rebound. Now for pointers it's possible, but context of use is still important. If it's just a pointer to whatever, then getters and setters are not needed. If the pointer needs to be set to a certain thing, then it probably shouldn't even have modification access at all outside the class.

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

    Might use some of this for a 4D chess game.

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

    can't get enough of your videos!

  • @canyonsea8298
    @canyonsea8298 7 ปีที่แล้ว

    Thank you Happycat, your terrific!

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

    "capture".... how peaceful XD.

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

    A nice class hierarchy.

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

    Amazing !!! Thank you for sharing this, I learnt a log 🔥!

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

    Easier said done. I tried cding chess in java but when i sit in front of the compiler i dont know how to use my objects with method and how they are going to move

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

    Thanks man you helped in creating a simple game from java

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

    you can do
    {
    }
    in settings editor

  • @David-lp4vj
    @David-lp4vj 5 ปีที่แล้ว

    This is an excellently made video, well done. Liked and subbed, your explanations are spot on

  • @uncoglione
    @uncoglione 9 ปีที่แล้ว +14

    if i promote my pawn to zergling would he come with speed/crack upg or?
    nice vid btw gratz

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

    Mam thanks for showing us about this project..But I just want to tell you that plz show step by step and make us understand.You are so lovely and helping poor java students like me.

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

      th-cam.com/video/i1faSzpsJD8/w-d-xo.html

  • @Toti_111
    @Toti_111 6 ปีที่แล้ว

    love your channel!

  • @marcusaureliusofromana1881
    @marcusaureliusofromana1881 8 ปีที่แล้ว +28

    Can you post the source code?

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

      @@f000ghk Thank you. But where is the .exe? How do I start the game?

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

      th-cam.com/video/i1faSzpsJD8/w-d-xo.html

  • @crr0004
    @crr0004 9 ปีที่แล้ว

    Great idea for a game project, love it. Wish I could post links in here, so many topics to discuss.
    I don't like the use of m_ for member fields because it is redundant and falls under Hungarian notation, which should only be used in special circumstances. I can understand not wanting to have shadowed fields, however the formal arguments should be renamed in that case. I've always followed that, when in classes, members take priority. If you are finding that you're naming local variables as the same as member fields, then consider what the local variables are really doing. E.G if you're copying a member field, name the local variable copyOf.
    I am very glad you mentioned unit testing, it is often over looked or disregarded. Unit testing is always a tricky point for programmers because it can hard to find motivation to do it and can very easily be a rabbit hole of never ending testing that detracts from the project.
    I have tried test driven development before and while I appreciate what it is trying to do, it goes too far. The way I do unit testing is that I only test things which are likely to break, contain bugs or have forking logic (think if statements). For example, I don't test set/getters, constructors, convenience functions (normally private anyway). However, I would test these if they are likely to contain bugs or having forking logic. I keep going on about testing however it is a rabbit hole topic.

    • @TheHappieCat
      @TheHappieCat  9 ปีที่แล้ว

      Chris R Hey, thanks for all the awesome comments! I definitely agree that test-driven development is too difficult for me to shift to. I like making small modules and testing them instead of writing all the tests first.
      And yeah, I get the dislike for "m_". It's one possible way to eliminate "this", but definitely not the best.

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

      @@TheHappieCat I need a chess game that can use my erc223 token, are you able to make me a Javascript chess game for my erc223 token, how much you charge for something like that?

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

    I will follow this with C#

  • @AxelWerner
    @AxelWerner 8 ปีที่แล้ว

    interesting insight on the backstage of a game. thinking of chess alone from a object oriented perspective alone seems quiet challenging and easy the same time, since everything is encapsulated and hidden within an object and does not interfere. i wonder what it was like with C or ASM only. no classes or objects .

    • @spartacuspro88
      @spartacuspro88 8 ปีที่แล้ว

      C has objects...

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

      Afaik C only has structs... C++ supports true OOP but c doesn't. That's why c++ is so strong and complex: It supports OOP and other high level features just like Java, C# etc. while also granting the low level access to the memory like C.

  • @leotan5601
    @leotan5601 8 ปีที่แล้ว

    Hi, I'm a student in software engineering.
    I don't know if you are reading this or not, but if you did i am very grateful.
    After watching your video i was wondering if this game can be run with only text base design (only using words to convey the situation) if it do, can i have a copy of your source?
    I wish propose this project to my lecturer for future teaching references in java object oriented programming.
    Thank you for your attention. :)

  • @KingButcher
    @KingButcher 8 ปีที่แล้ว +50

    "created by anne 9/11"

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

      she created this on 9/11.
      did Shrek do 9/11?

    • @nathan-or3gr
      @nathan-or3gr 8 ปีที่แล้ว +18

      King Butcher anne frank done 9/11 confirmed

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

    If you can make a video about the Design process of an oop project, like how you Design objects and classes ... It would be really great! Anyway, Amazing video 💯!

  • @seren9990
    @seren9990 6 ปีที่แล้ว

    YOU'RE AMMAZING!!!! I'MA FAN ALREADY UGHHHHH

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

      hey seren,
      Please watch: "XO game with basic code in JAVA || blueJ "
      th-cam.com/video/eqjuKl2BxB0/w-d-xo.html
      Please watch: "How to make FLAMES program in Java "
      th-cam.com/video/ld_-BvuGIWY/w-d-xo.html

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

    Of course, you could comment your code, but avoid redundant ones, instead you could convey most of them in the identifiers' names.

  • @Meneltour27
    @Meneltour27 7 ปีที่แล้ว

    Why do you need to store the type of the piece? In getType you write the piece type directlly in the output. Am i wrong that i dont see a use for type variable?

  • @NovaCyn
    @NovaCyn 8 ปีที่แล้ว

    for an example of making chess into a totally different game check out chess evolved (Its free to play, and should be easy to find on google)

  • @pele220
    @pele220 8 ปีที่แล้ว

    this is really good , thank you for sharing

  • @caharkness
    @caharkness 8 ปีที่แล้ว

    Not to yank your chain, but isn't having a bishop enum assigned to an instance of the bishop class redundant? When evaluating an object, you can always use the instanceof evaluation, e.g. "if (Board.getPieceAt(0, 0) instanceof Bishop)"

    • @grundeir
      @grundeir 8 ปีที่แล้ว

      I agree it's redundant, but don't use instanceof. Instead, one way to resolve it would be to simply return Type.BISHOP directly from the getType() implementation. Another way would be to store Type in the superclass (i.e. Piece), rather than in Bishop.

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

    Could you share this project by any chance? I'd love to fork it and learn the code logic and structure, it looks pretty neat.

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

    My mind: i need to make a game
    After watching this video ,Me: shit i can't do this

  • @hauntedtrap3479
    @hauntedtrap3479 7 ปีที่แล้ว

    what games do you play?

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

    Im sorry but the Zergling class of the Peices package in 3:40 really distracted me LOL

  • @jakob7281
    @jakob7281 8 ปีที่แล้ว

    I know im a bit late but can you tell me which library you would use in c++ for the window and drawing etc. and if you know one, tell me a good way of learning how to use this library pls... (Is sdl and opengl a good choice?)

  • @gungeek423
    @gungeek423 8 ปีที่แล้ว

    Zergling? Awesome, somebody liked her starcraft!

  • @gosnooky
    @gosnooky 6 ปีที่แล้ว

    Encapsulation is your friend.

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

    I'm guessing there's a library you import.. you don't mention that.

  • @NathanaelCrapo
    @NathanaelCrapo 8 ปีที่แล้ว

    wouldn't it have been better to have done p_x and p_y instead at 5:50, since you'll only work with the parameters for a little bit there you wouldn't need to change a bunch of things latter

  • @Lukomeyan
    @Lukomeyan 8 ปีที่แล้ว

    I see we have something in common :D. I also prefer to have my brackets in-line. I don't know how people can read code where the bracket starts on the line first line like "class myClass {". I find code much more readable the other way.

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

    I really need this theme in intellij

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

    I'm watching this because I'm trying to implement chess (including castle, promotion and en passant) following OOP principles. Your code seems pretty well partitioned, organized and commented. However, I have some questions/suggestions: Why not just use instanceof to check whether a Piece is a Bishop, Rook, etc instead of having each class explicitly declaring the type? And why not refer to the fields as this.player instead of m_player? This is standard practice and prefixing all class fields to distinguish them from method parameters is more difficult to read.
    Have a nice day!

  • @Abstravels122
    @Abstravels122 6 ปีที่แล้ว

    Does drawPath basically mean to move the piece? If so, once you check its valid, cant you then just assign the x & y values as the new coordinates?

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

    Me: *cries in Class a {
    public static void main(string args[]){|}
    System.out.println("hello world")
    }*

  • @misterchef4239
    @misterchef4239 8 ปีที่แล้ว

    How much would it cost to hire you to make this chess to be able to play on browsers through websites?

  • @markstephenbueno4314
    @markstephenbueno4314 6 ปีที่แล้ว

    what is the beginning of the java?

  • @fortoday04
    @fortoday04 9 ปีที่แล้ว

    I'm having a little trouble getting into programming. Would you be able to make a tutorial on something like this? I know how to do basic things, but the workflow required for something of this scale is still confusing to me.

  • @Mbd3Bal7dod
    @Mbd3Bal7dod 7 ปีที่แล้ว

    I did a mine sweeper with java
    My problem is with swing I don't like it. Is there's a good alternative?

  • @YBuda101
    @YBuda101 8 ปีที่แล้ว

    I love your videos!

  • @silversk8erz
    @silversk8erz 8 ปีที่แล้ว

    Hello HappieCat, I'm trying to understand where is your Player Object/Class that you use? I'm currently a sophomore in college & this project for me will be my first project, I think it will be hard and tedious but I think I can do it!

    • @silversk8erz
      @silversk8erz 8 ปีที่แล้ว

      I already made the checkerboard panel with the squares, but as for the pieces themselves I'm thinking of doing an ImageIcon type of thing that's the only way I know how to get the image to appear.

  • @RUFFRIDE
    @RUFFRIDE 9 ปีที่แล้ว

    where can i find sources to this, if they are available?

  • @ronixx1955
    @ronixx1955 9 ปีที่แล้ว

    hello happiecat, i got problems with the import thing, i just copied your " import Game.*; " but it says that package does not exist. I know i'm noob in java but I really want to learn this project, please help :/

  • @xcrysesreflexx629
    @xcrysesreflexx629 8 ปีที่แล้ว

    Im Just wondering I've started of learning c++ but haven't gotten to far into it, should put that on pause and learn Java first and if so which Java , because there are different types of Java ..... Aren't there ...?

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

    where do I find the source code?

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

    I like your style

  • @jimfcarroll
    @jimfcarroll 6 ปีที่แล้ว

    Great videos. This is the best intro to some of these topics I've seen. One criticism on this one though: Ugh! Modern IDEs makes Hungarian notation superfluous boilerplate.

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

      Please watch: "XO game with basic code in JAVA || blueJ "
      th-cam.com/video/eqjuKl2BxB0/w-d-xo.html
      Please watch: "How to make FLAMES program in Java "
      th-cam.com/video/ld_-BvuGIWY/w-d-xo.html

  • @edgarfabriciobarbaflores5745
    @edgarfabriciobarbaflores5745 8 ปีที่แล้ว

    hi, I'm trying to draw a chess game in a JPanel, I have the board but I don't know how to draw the pieces. What can I try?

    • @BrandNewByxor
      @BrandNewByxor 8 ปีที่แล้ว

      If you make a class that inherits from JPanel (public class MyPanel extends JPanel)... Then you can paint on it by doing this...
      @Override
      public void paintComponent(Graphics g)
      {
      super.paintComponent(g);
      // All your painting code goes here
      }
      You'll need to import java.awt.Graphics and javax.swing.JPanel.
      I'd look at some swing painting tutorials first.

  • @n.g.9705
    @n.g.9705 6 ปีที่แล้ว

    Do you give the full source code? I'd love to try to modify it.

  • @ziajek444
    @ziajek444 7 ปีที่แล้ว

    what is diffrence betwen quin an princess? Which of them is Hetman?

  • @thothheartmaat2833
    @thothheartmaat2833 8 ปีที่แล้ว +5

    can you do a start to finish project going over everything about coding and what you're doing? i cant learn code because I cant learn in random fragmented chunks which is the only way anyone wants to teach code. let's ignore everything about how to start a project and talk about something random or some abstract coding theory. that's how every code class starts and I just have a million questions.. what's that.. what's that.. what's that.. never mind.. we won't talk about that now.. let's talk about something random.. I need start to finish explain what everything is as we go. i think that would be the best way to teach coding but no one does that. save the theory for later. for example. what is the first thing I type in a project.. why? what is the next thing? why? the next.. why? etc.. something for a specific project. I can't handle learning all possible things first then learn why and how they are practical long after. I'll never remember all that and feel like it's just wasting my time.

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

      Maathiu Ra Yin look up 'the new boston'. They have tutorials where they start from scratch in multiple programming languages.

    • @thothheartmaat2833
      @thothheartmaat2833 8 ปีที่แล้ว

      Andreas Vida that's actually what I do. it's a very practical way of learning. I will read wikipedia's, find things I don't understand then click the link and read about that and keep going and going. maybe I'll try doing that with coding. i cant learn if I never know why anything is being explained. .when people say I'll get back to this later is my biggest pet peeve. explain it now that im thinking about it! i don't understand it, they mentioned it as part of what I need to understand what they're talking about but I don't know what it is so I don't know anything about what they're talking about at all and im just wasting my time listening to them. they'll start in the middle in some weird random spot without any context. i need the context. the overview.

  • @asemmalayshi3915
    @asemmalayshi3915 9 ปีที่แล้ว

    is it a one to one game or you vs computer?
    in other words , does the game think and decide which move is better ?

  • @antonyquigley5219
    @antonyquigley5219 7 ปีที่แล้ว

    Hi, no one seems to do this. But could you should me something? Thats not complicated. ALl i want, is for someone to show me, how you take say a character from a spritesheet (basic is fine), and take a planet green background (to represent grass) and code the character from the sheet to move around in a top down fashion with up down left right keypresses.
    Just a basci character, moving up down left right on a green background from 4 directional keypresses. no physics or jumpng or anything. i just want to see how much work goes into the simplest thing, and how hard/easy it is to use a sprite sheet to make a character move around. Thank you

  • @ЛевПоляков-я7з
    @ЛевПоляков-я7з 5 ปีที่แล้ว

    Hello. In which class is your while loop with player change (white-black-white-...)? And one more: if I want to create class Computer which will generate moves and choose the best from it, how can I get all valid moves that black has for example?
    P.S. good video :)

  • @notoriouswhitemoth
    @notoriouswhitemoth 8 ปีที่แล้ว

    Shougi would probably be easier to program, tbh - it's more or less the same mechanically, but without check.

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

    It would be amazing to have you teaching how to use JavaFX, although I understand that making this kind of tutorials doesn't fit your style. I just thought I should mention it because you're such an excelent teacher :D

  • @MrNat43
    @MrNat43 9 ปีที่แล้ว

    I am loving it

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

    Can you publish the project because i want to look at stuff in detail like the Checkmate system. plz :D

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

      You could publish it on dropbox and put the link to the download in the description also subbed :D

    • @funkdoc94
      @funkdoc94 6 ปีที่แล้ว

      GitHub or another version control would be more appropriate. :)

  • @jamespogg
    @jamespogg 7 ปีที่แล้ว

    Did you use JavaFX for the GUI?

  • @xrillo281
    @xrillo281 8 ปีที่แล้ว

    I love your voice lol its soothing *.*

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

    What IDE you're using?... I can't see from my phone

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

      Root Tech intelliJ

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

    I'm a first year computer science student, I'm new to java and I have no idea what are you saying :((

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

      th-cam.com/video/i1faSzpsJD8/w-d-xo.html

  • @joshguevara9570
    @joshguevara9570 6 ปีที่แล้ว

    So is this purely for practicing with structures or is it a functional game that can be displayed on screen?

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

    at 12:49 she could save all comments by naming her variables better. Like instead of int pairs make it int pathLenth. Another thing is, that comment common abbreviations is not good. If someone that reads your "well commented code" and have to deal with to many comments that are not explaining, but repeating whats already written, he will automatically ignore comments by the time and maybe miss something important. In our company we only write summaries for methods and comment only stuff thats "unusual" like when a for loop does not increment by one but by 4 for example. That keeps the code slim and clean. Last but not least there is no shame in using a bit longer names to make code more readable, not to long tho. Code itself should be readable like a book or a poem.

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

    Does anyone know where to find the source code ?

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

      th-cam.com/video/tyE0Fbdxum4/w-d-xo.html just watch it maybe this could help u

    • @amitfritz11
      @amitfritz11 6 ปีที่แล้ว

      Here you go. github.com/anneomcl/ChessLibrary

  • @LoganDark4357
    @LoganDark4357 8 ปีที่แล้ว

    Java? imho I actually think Python is a better starting point. after all, it's a very simple language but with libraries like tkinter, curses, etc you can create some really amazing things

  • @saniaobroei5372
    @saniaobroei5372 7 ปีที่แล้ว

    an u suggest som topics o miniproject based on java andgraphics for IT

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

    Hey TheHappieCat,
    thx for the video.
    Using all the inheritance is a little bit outdated by now. All the "hard wiring" by using iheritance has it's downsides.
    You would rather go for "composition over inheritance" - even to model your behaviour.
    Before I would use any "abstract class" (if any) I would rather remove all the public members which is clearly a code smell. Puplic members mean that you violate the open closed principle and this violation makes your life that much harder. And even if you don't access this members in a public way, way make them public in the first place?
    The Type enum is a strange one. Why? You already have a type "your class" and each of the classes needs a extra member to hold it's "Type"? Why? They even have the same name. An object is very aware of the class it was intantiated from
    I know this is just a learning project but some of the stuff might find it's way to production code so we should point out that it's not the way to go.
    On the other hand I love that you write tests which is a big bonus.