All,
I'm trying to have enemy deaths increment the player's number
of coins (e.g. I have 3 coins, I kill an NPC, now i have 4 coins).
I thought this would be relatively easy (and it may be), but I've been struggling with it for countless hours now.
(Please note: I'm extremely new to computer programing, let alone Java. I have zero education on it outside of what I read/watch on the internet this year. Needless to say I'm in way over my head).
With that said, I learn best by doing, so in case anyone still reads this group and wants to help an amateur enthusiast out, here's what I was thinking that's failed.
The "HitReactionComponent" class states:
if (mDieOnAttack) {
parent.life = 0;
}
Later on it states
case CollisionParameters.HitType.DEATH:
// respect teams?
parent.life = 0;
break;
My thoughts were to add code within these if statements that simply say to add a coin the player's inventory.
Something along the lines of:
InventoryComponent.UpdateRecord addCoin = new InventoryComponent.UpdateRecord();
addCoin.coinCount = 1;
I also attempted other similar things regarding the variable in the HudSystem class, among others.
Any thoughts?
Thanks!