PDA

View Full Version : OOP Diagram



Tamamo
02-13-2015, 11:17 AM
With ZC approaching Opensource, I think our first order of business should be to create an object oriented programming diagram containing the classes and what inherits from what. I was thinking Using yEd for this would be best. Thoughts? Link below.
http://www.yworks.com/en/products/yfiles/yed/

CJC
03-08-2015, 09:48 PM
Not great with the whole object-oriented scene, but I was thinking that we could simplify the objects themselves and give them boolean properties to determine characteristics (I'm looking at you, WEAPON)!

Thing

Has coordinates
Has Width, Height, and Depth. These establish the hit box.
Has a function to detect collision and one to toggle it on and off
Has Directional velocities
Has a TILE and CSet
Has Animation Frames
Has Animation Speed
Has TileWidth, TileHeight, and TileDepth, which set its visual width and height in multiples of 16 and its layer draw position (TileDepth). Note that these are NOT used in collision detection and they can be adjusted to be different from the Width, Height, and Depth.
Has a bool 'invisible'
Has a miscellaneous array


Combo (Inherits from Thing)

Has a solidity 3D array which is pixel-by-pixel and assembled based on the size of the combo. When a collision is detected, the game compares the solidity array of two combos with a NOT AND comparison. If any of the overlapping indices return true from such comparison, a collision effect is triggered.
(The combo's solidity would need an editor just like the tile editor; players could edit the combo with the same tools and 'paint' the various types of solidity onto each index of the combo's collision array)
Has an array of booleans to assign combo types
Has an array of booleans to assign inherent flags


Weapon (Inherits from Thing)

Has Damage
Has an array to dictate which factions of enemies it can harm (Link, Guys, Enemies)
Has a deadstate
Has an array of flags that it triggers on collision
Has an array of combo types it triggers on collision


Guy (Inherits from Combo)

Has directions and an animation style.
Has a Health variable which can be set to -1 for invulnerability
Has an Action array

Enemy (Inherits from Guy)

Has a movement pattern
Has a Hunger rating
Has a Projectile Type
Has a Projectile Style
Uses its miscellaneous array to dictate behaviors
Has a defense 2D array which takes WEAPONS and constants that dictate how the enemy reacts to the weapon (Knockback, Stun, Shield, Damage Multiplier, CounterWeapon)
Has an on-hit tribble variable with two values (#of target enemy, # to spawn)
Has an on-death tribble variable with two values (as above)
Has an on-timer tribble variable with three values (# of target enemy, # to spawn, Timer duration)

Link (Inherits from Guy)

Has button input bools
Has a Magic variable
Has counter variables
Has an owned item array


I know this doesn't cover everything and I've even missed features that some of these objects need to have. It's just a start to help other people come up with a better diagram.