Thursday, June 20, 2013

I just took a break from the "code"

For anyone who finished a large programming project my hats off to you. I saw the forrest of my doom... regrouped, and formed a frontal attack. I hacked in some combat, mostly finished the anination class. The zombies will attack and destroy doors if they are chasing you. There is no visual cue to show damage being taken and I will need to make some temporary visual for that and I must seperate the movement of the player and the enemies to seperate timers.

I used my first method with varargs for this. So, player:adjustDamage(-1,-5,2) will pass a list{-1,5,2} as an argument to be added by the method function Player:adjustDamage(...). This rocks. A good example of it's use is damage to a zombie standing in fire and being shot while eating flesh. From the previously defined adjust:damage(-1,-5,2) we see the total adjusted damage wound be -1 + -5 + 2 = -4. It makes damage a number to be generated in the weapon class and environmental class. I will not have to write(accept in this example): if fireDamage ~= nil then totalDamage += totalDamage fireDamage end. I need see if I pass in a list will it make a list out of my varargs, or can I just loop through the passed in variables.

I will have a video soon and I will demonstrate some combat.

No comments:

Post a Comment