Knockback - How to Make a 2D Game in Java #41

In this video, we implement additional combat mechanics so we can destroy monsters' projectiles and also knock them back.
Guidelines for using Blue Boy Adventure's code and assets:
docs.google.com/document/d/1q...
Timestamps:
0:00 Introduction
0:51 Cutting down monsters' projectiles
6:24 RESULT
7:50 Adding knockback effect
14:05 Adding knockback power to weapons
16:59 FINAL RESULT
#javagamedevelopment #javagametutorial

Пікірлер: 31

  • @johnwinters1705
    @johnwinters17052 жыл бұрын

    These videos are absolutely amazing, hope you do a turn based battle system in the future...like Final Fantasy or Pokemon. Looking forward to all your future content.

  • @michaelharrington5860
    @michaelharrington58609 ай бұрын

    Finished up the A* videos today. Really took my time with both of them, but will definitely rewatch them multiple times in the future to solidify the concept and logic. Everything is working great so far. Looking forward to implementing knockback tomorrow! Thanks RyiSnow!

  • @laurenzfitzner
    @laurenzfitzner2 жыл бұрын

    I really like the knock back system Thought about this for a wile, so it's nice to see you working on it

  • @adnan2734
    @adnan273411 ай бұрын

    If only these series would last forever :)

  • @momagi6039
    @momagi60392 жыл бұрын

    Glad to see the latest episode of the video so soon

  • @kikismine
    @kikismine2 жыл бұрын

    Nice new video from RyiSnow

  • @Sweperly
    @Sweperly2 жыл бұрын

    Wow! i'm at the 6# episode and i watch this one to know the end, and it looks amazing! And will it ever end?

  • @javierbernardosaura8934
    @javierbernardosaura89342 жыл бұрын

    Great video! I think it's a good idea to create a discord for us to implement new mechanics to the game and help each other. (sry for my english)

  • @Melvin-14
    @Melvin-142 жыл бұрын

    hey, rysnow, do you know how to make the mobs play attack animations? i really need this, when i tried to do it they would just keep playing the animation and would play it really fast

  • @MrLoser-ks2xn
    @MrLoser-ks2xn Жыл бұрын

    Thanks!

  • @FerodriEste
    @FerodriEste2 жыл бұрын

    Excellent video Ryi. For later it would be great that when you kill all the slimes, somehow they spawn again but stronger (more hp, attack, defense, speed)... I don't know, it seems like a good idea to give it a story without end!! hehe.

  • @LORF0
    @LORF02 жыл бұрын

    Great video! Will there be a video on crafting system?

  • @RyiSnow

    @RyiSnow

    2 жыл бұрын

    What kind of stuff do you want to make with the system?

  • @LORF0

    @LORF0

    2 жыл бұрын

    Stuff like tools for example. But looking at the current state of the game adding a crafting system is a bit early since there isn't any sort of materials to be collected like wood or things from caves(which is a whole different system by it self to be added). Probably be best for the next new game series or at the final stages of this current game. Thanks for the reply tho!

  • @OneLatteComingRightUp
    @OneLatteComingRightUp3 ай бұрын

    Hi Ryisnow, I was wondering if you could make the player take knockback from monster projectiles?

  • @michael_hraje
    @michael_hraje2 жыл бұрын

    Hey, i was wondering how could you easily implement an option for multiple languages in game. I thought about using dictionaries, but the way i wanna do it just seems way too complicated. Do you have any tips for that? Thank you :D

  • @RyiSnow

    @RyiSnow

    2 жыл бұрын

    Sorry, I don't really understand your question Do you mean you already have translated texts and wondering how to implement them?

  • @michael_hraje

    @michael_hraje

    2 жыл бұрын

    @@RyiSnow i havent translated the texts yet, but i want to try implementing the translation as another option and i am wondering how to do that the best way possible

  • @Merkuse

    @Merkuse

    Жыл бұрын

    @@michael_hraje Add a variable that is responsible for the language. Then put "if condition" in each place where the program writes the text. Something like "if (lang == "eng") {// write English text} and so on

  • @od1367
    @od13672 жыл бұрын

    THank you!!!!!!!!!!!!!!!!!!!!!!

  • @Sweperly
    @Sweperly2 жыл бұрын

    And also, i got a suggestion wich is pretty hard or idk but, it's to make the game multiplayer (LAN) but I think it's waaaay too much for now

  • @woodswoody5553
    @woodswoody5553 Жыл бұрын

    💪

  • @hawkale140
    @hawkale140 Жыл бұрын

    This one was very interesting! the only problem is that if i shoot a fireball and then change direction, the monster will be pushed in the new direction and not in the right one. For example: o x "o" is me and "x" is monster. if I shoot and then run to the left before the fireball hits the monster, the game reads that my direction is left so the monster is "dragged" towards me and not pushed away. I tried adding the direction of the hit when calling the method damageMonster but it doesn't seem to fix the problem...

  • @RyiSnow

    @RyiSnow

    Жыл бұрын

    You're right. That is a bug. If you want to add knockback power to projectiles and avoid the issue, here's a quick fix: public void damageMonster(int i, int attack, int knockBackPower, String direction) // receive direction parameter damageMonster(monsterIndex, attack, currentWeapon.knockBackPower, direction); // pass direction parameter knockBack(gp.monster[gp.currentMap][i], knockBackPower, direction); // pass direction parameter public void knockBack(Entity entity, int knockBackPower, String direction) // receive direction parameter gp.player.damageMonster(monsterIndex, attack, knockBackPower, direction); // pass projectile direction else if(collisionOn == false) { switch(gp.direction) // change from player direction to entity direction This way the knockback direction should be handled properly.

  • @hawkale140

    @hawkale140

    Жыл бұрын

    @@RyiSnow thank you, I really appreciate you always answer my doubts

  • @MrLoser-ks2xn
    @MrLoser-ks2xn8 ай бұрын

    🥰🥰🥰

  • @christianfryksten8524
    @christianfryksten8524 Жыл бұрын

    Upon attacking, my character freezes

  • @Minecraftgamer-gb5ow
    @Minecraftgamer-gb5ow2 жыл бұрын

    Hi ryi. My comment got deleted because it had a link in it I think. There is someone on tiktok that took credit for some of your work and I thought you should know.

  • @RyiSnow

    @RyiSnow

    2 жыл бұрын

    Really? Can you tell me a search keyword that leads to the video?

  • @rolandspolovnuks6223
    @rolandspolovnuks62232 жыл бұрын

    @RyiSnow Hey, I am wondering could you create a lot of bouncing balls in the box ?

  • @RyiSnow

    @RyiSnow

    2 жыл бұрын

    What?