Java 2D OpenGL RPG Tutorial 7: Getting the player to attack.

preview_player
Показать описание
In this video we finish the basics of our combat system by letting our player attack.
Рекомендации по теме
Комментарии
Автор

Thanks you !! those tutorials really helping me out a lot!
i hope you keep it up and upload some more :)

MzDayGaming
Автор

Are you going to upload more? I really enjoy these and they are incredibly useful! Please make more of these videos! Your awesome benny!

Slyth
Автор

I have a suggestion for what you next video could be about: Talking to an NPC. Also, maybe have NPCs walking back and forth on set paths.

SergeantBalthazar
Автор

Hey man. Thanks for these tutes. I'd love to see one on a camera class/scrolling maps.

Tchomify
Автор

Instead of using integer constants for direction it may be better to use an enum, that way you can use a switch statement for selecting the correct collision rectangle.

You can also use polymorfism, but that would mean the calculation is moved to the enum itself, and since the calculation is quite game specific, you don't want it in your generic classes.

tabularasa
Автор

My player is only able to attack enemies while it's directly on top of it. What do you think the issue is?

dynasticc
Автор

Hi Benny, I haven't seen Ep.8, but I've found a bug in the player attack. This is how direction should be evaluated:
switch (facingDirection){
case FORWARD: objects = RPGMain.rectCollide(x, y, x+SIZE, y+SIZE+attackRange); break;
case BACKWARD: objects = RPGMain.rectCollide(x, y-attackRange, x+SIZE, y+SIZE); break;
case LEFT: objects = RPGMain.rectCollide(x-attackRange, y, x+SIZE, y+SIZE); break;
case RIGHT: objects = RPGMain.rectCollide(x, y, x+SIZE+attackRange, y+SIZE); break;
}

NevrilAioros
Автор

Alright well, here's something you should know about me: when I'm making suggestions for a particular series and I say "in the next video you should..." I really just mean at some point in the series ;)

SergeantBalthazar
Автор

Well, yeah. I probably should have changed it a little bit more. I just took it from the Pokemon damage calculation, and since that programming is different... you know.

SergeantBalthazar
Автор

Will part 8 be up this weekend? (Sorry for kinda spamming, just so excited :D)

SergeantBalthazar
Автор

How would you make it so that when you click the left mouse button, the player attacks?

SergeantBalthazar
Автор

Is it almost ready to be uploaded? I'm getting really fidgety.

SergeantBalthazar
Автор

So what you're saying is that what we see up there is not recorded all at once?

SergeantBalthazar
Автор

Continuing: my getDef() is returning 60 + (getLevel() * 4), so it's 64;
and my DMG_CONST is returning getLevel * 2.25, so it's 2.25;
Now, this doesn't seem to work at all, but when I just have attackDamage = 1 or something like that, it works just fine. I also tried doing a getAtkDmg() method in stats, but that didn't work either. So, what the heck is going on? Tell me if you need to look at my source

SergeantBalthazar
Автор

So pretty much 1 video takes anywhere from a half to a full day?

SergeantBalthazar
Автор

So, I take it that you are a very, very busy man person?

SergeantBalthazar
Автор

I'm taking that it will not be up today (9/5/12)

SergeantBalthazar
Автор

Benny ^^, Check your inbox, there is a suggestion for a ( better ) way to find the closest enemy, from me.

larsmagnusny
Автор

So, my damage function is not working. I have my attackDamage set to * getLevel() / 5 + 2) * getAtk() * getWepDmg() / getDef()) / 50) + 2) * DMG_CONST); So, let me go step by step: at the moment, my getLevel() is 1, because I have 0 xp; my getAtk() is 50 + (getLevel() * 5), which makes it 55; My getWepDmg() at the moment is just returning one. I'll continue on the next comment. (Might have to be 3).

SergeantBalthazar
Автор

:L It certainly takes you a long time to make these tutorials, doesn't it? Is it because it takes forever to render these giant videos, or what?

SergeantBalthazar