JavaFX Game Tutorial: Memory Puzzle

Поделиться
HTML-код
  • Опубликовано: 24 окт 2024

Комментарии • 35

  • @edwin3866
    @edwin3866 3 года назад +1

    Almas, I am totally grateful for his teachings, I have learned and had a lot of fun, my thanks for your channel

  • @MrZZooh
    @MrZZooh 6 лет назад

    You sir are a life saver. I know have a complete working blue print for this assignment.

  • @iwlazaki
    @iwlazaki 7 лет назад +5

    Hello! Could you make a tutorial like this using Scene Builder for the Memory Puzzle?

  • @wodstalker2819
    @wodstalker2819 5 лет назад

    Hi
    Im writing a project based on your structure of Tiles (coding a 2048 game)
    I'd like to compare the content of a Tile to the empty string, to prevent the game from adding a new string on an allready filled tile with something like this : if(tiles.get(pos1) != ""), where pos1 is a randomly generated position for my number to be inserted in, and tiles is my ArrayList containing the tiles...
    As you may have guessed, this statement gives me an error, as it compares a Tile to a string... What should I do to correct it ?

  • @abedismail6860
    @abedismail6860 4 года назад

    We want an example MVP with images can you help us

  • @NeoAzul97
    @NeoAzul97 6 лет назад

    Has someone managed to fix the bug of the open tile?? I can't figure a way so I can determine if the animation has ended.

  • @aliyazhang6124
    @aliyazhang6124 6 лет назад

    If I use a for loop goes row by column to display the tiles and add each image to each tile by using stackpane, and then add the stackpane to gridpane to display game board. How do I compare the images??

    • @AlmasB0
      @AlmasB0  6 лет назад

      I would use setUserData(imageName), where imageName is a String that identifies the image. Then comparison becomes trivial - you just compare the imageName.

  • @DanHowardMtl
    @DanHowardMtl 9 лет назад

    It seems you can can prevent fast clicking by just using the event.getClickCount() as well. Just change if (isOpen() || event.getClickCount() > 1) return; } - there are a couple of extra null checks I added as well.

    • @AlmasB0
      @AlmasB0  9 лет назад

      ***** It seems to be a more elegant solution too since there is no need to introduce new variables. However, do be careful because click count is based on the delivery of native OS events and therefore is likely to demonstrate inconsistent results on different platforms. Here's more info if you are interested - docs.oracle.com/javase/8/javafx/get-started-tutorial/jfx-architecture.htm and docs.oracle.com/javase/8/javafx/api/javafx/scene/input/MouseEvent.html#getClickCount-- Nevertheless, as far as the tutorial is concerned sounds like a nice solution. Kind regards

    • @DanHowardMtl
      @DanHowardMtl 9 лет назад

      Almas Baimagambetov Good point. Thanks.

  • @aliyazhang6124
    @aliyazhang6124 6 лет назад

    How do we check if all the tiles are opened,(the game is over)

  • @Юлия-х3б3з
    @Юлия-х3б3з 8 лет назад

    Always get an error "Thread.java:745" and others associated with the flow. At the same time on the field remain open letters, even though they do not have a pair. What could be the reason and how can I fix it?

    • @AlmasB0
      @AlmasB0  8 лет назад

      +Юля Короткина Hi, there must be something you've missed. You can check your code against the original here - github.com/AlmasB/FXTutorials/blob/master/src/com/almasb/mp/MemoryPuzzleApp.java

  • @sweekeung
    @sweekeung 4 года назад

    Hi can help me create a game using javafx?

  • @Brosephv
    @Brosephv 4 года назад

    If I was to make this game with images how do I compare their values?

    • @AlmasB0
      @AlmasB0  4 года назад

      You could assign each image a unique id, such as file name. The next step would be, when creating an ImageView, to set a property, say "String imageID". Then comparing two ImageViews is trivial -- just compare their imageID.

  • @gurpreetsingh-wp8zn
    @gurpreetsingh-wp8zn 8 лет назад

    Hey !! can you tell me how can i put random imageview in array list ..?

    • @RoadBitxx
      @RoadBitxx 8 лет назад

      +gurpreet singh try Collections.shuffle()

  • @RoadBitxx
    @RoadBitxx 8 лет назад

    Thank you for this tutorial! I tried to make this using images and a gridpane but for some reason the images don't vanish when they are different and I don't know why. Oo

    • @RoadBitxx
      @RoadBitxx 8 лет назад

      +YouKnowWho685 never mind i fixed it. ^^

    • @waltermitty2417
      @waltermitty2417 6 лет назад +1

      I'm stuck there right now. How did you get it to fade out?

    • @aliyazhang6124
      @aliyazhang6124 6 лет назад

      how did you do it ??

    • @naanigundu8090
      @naanigundu8090 2 года назад

      could you please share the code ?

  • @Mafia2gameplayer
    @Mafia2gameplayer 7 лет назад

    How can I set image(rectangle Fill) opacity to 0, but keep the rectangle stroke?

    • @AlmasB0
      @AlmasB0  7 лет назад +1

      Hi, I don't quite understand what you mean. Are you using an ImageView and want to make it transparent while keeping the stroke? Use StackPane with the rectangle being the first node and set its fill to null. That way you get the stroke around the rectangle but not the fill. Then, add an ImageView as the second node to StackPane and make it invisible or set opacity to 0. Reveal the image when needed. See if it helps.

    • @Mafia2gameplayer
      @Mafia2gameplayer 7 лет назад +1

      Almas Baimagambetov Thanks, helped!

    • @aliyazhang6124
      @aliyazhang6124 6 лет назад

      hi after that how do we reveal the image?? I was planning to use a setonmouseclicked event and inside that event set the opacity to 1 but It does not show up

  • @MProductionsHU
    @MProductionsHU 7 лет назад

    Can you explain why is it (50 * (i % NUM_PER_ROW)); please?

    • @AlmasB0
      @AlmasB0  7 лет назад +1

      Hi, it allows us to obtain the remainder of the division. In practice, i % NUM_PER_ROW is less than NUM_PER_ROW. So, when setting the X position we will never go out of "bounds". Search for modulus division for more information.

    • @MProductionsHU
      @MProductionsHU 7 лет назад

      Thank you!
      Could you do this game using FXML please? I would really appreciate that. Thank you in advance.

  • @learn001
    @learn001 5 лет назад

    Please make Ludo King game in JavaFX.

  • @husnainipalondongan9526
    @husnainipalondongan9526 2 года назад

    Am not too understand about this vidio ,