Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

To Bug, or not to Bug

Hi all,

New here and loving it!!

I realize this is not the location for logging potential bugs, however, I’m quite new to JavaScript, but a long-time video game bug tester… and so, my brain is a little confused on whether this is actually a bug, or if I do not quite have a deep comprehension yet - so, please forgive me, and any help in understanding if I’m missing something or confirming if it should be added to bug world would be appreciated!!

Game Development 2, Game of Coins Step 4: Power-Ups, JavaScript
Fresh code with no user alterations
Line 95 of code boosts “Knight” attackDamage to 100 for powerPlayerUp.
Line 102 (according to comments) removes the power boost, and returns player to “normal state”
Knight’s default attackDamage parameter is 4.32, not 1

Is this a typo in the supplied code? Or, is this functioning like the player.scale modification (where 1 represents 100%, 2 represents 200%, etc)?

Is the attackDamage in the game a 100x boost when the powerPlayerUp is added (so Knight’s force would be 432)? Or a boo boo?

It seems super knit-picky, and I apologize - it really is that I want to learn the behavior for modifying the default spawn parameters accurately!

Thanks for any info (picture is attached to clarify my confusing explination!)

Sheena

Hi Sheena…welcome to the forum!

I’d not yet started Game Dev 2 and I am taking the Python route, so cannot directly answer your question. I should be at the Step 4 level soon, so may can give some insight. I’m not very proficient in JS, yet, but I can at least read it and get a good idea of what is intended. At the least, we’ll see if the the PY version has a similar ‘bug’.

1 Like

Thanks, I look forward to your thoughts! And, I just noticed I wrote Web Dev instead of Game Dev, so, sorry about that…time for a nap!

No worries…I figured out what you appeared to have meant :smiley:

1 Like

Thank you! I was logging an actual bug for my missing Web Dev campaign and my grey matter got all discombobulated. :blush:

1 Like

@SheenaMusic…so, it’s the same in the PY version. However, I think it’s a mute point, because in this scenario, we can’t attack the scouts anyway.

1 Like

Hey, thanks so much @dedreous for the update about it’s inclusion in the python side as well.

Yes, it doesn’t have anything to affect on the gameplay for this level, so I know in this specific collection of variables it’s moot.

I posted (and haven’t yet marked as solved) cause I’m wondering if someone who has experience on the dev side of the spawned character default parameters can educate me on how each of these traits are inherently coded for my own future knowledge in the levels and game dev challenges I haven’t reached yet.

I think I’m correct in assuming that the scale mod is a 1=100% relationship.

I just don’t know if the attackDamage is the same, or 1=1, or how it’s natively setup, and I’ve not yet researched enough to read or parse the backside setup docs to efficiently locate this answer!

Thank you so much for your input here - everyone is so helpful and kind! It’s super appreciated!

Hi there,
I think that when you set the attackDamage to 1, it does actually equal one, and likewise for 100. I don’t believe it’s on a 1-100% relationship. It would make sense, but doing some debug you can see that’s not what’s going on (at least for me).

hero = game.spawnHeroXY('knight', 12, 34)
hero.attackDamage = 100
hero.say(hero.attackDamage)

When I run this code using tharin, whose stats are this:
Screen Shot 2020-02-21 at 10.09.29
He says:
Screen Shot 2020-02-21 at 10.23.14
And when you use the same code with the Samurai, whose stats are this:
Screen Shot 2020-02-21 at 10.09.40
He also says:
Screen Shot 2020-02-21 at 10.25.02
And the same applies when you try it with 1, instead of 100.

I think the “Default Stats” are what you have at the start of a level before you’ve changed anything, and, it gives you difference between the heroes without having to code it yourself. But you can change it to whatever you want.
And then in the level where it says: "the function returns the player in the normal state.
It means the normal state for that specific level, not the default attackDamage.
I’m not 100% sure about this, but doing the debug It does seem most likely, to me at least.
I hope this helped you understand it.
Danny

That’s great info! Thanks so much!!