Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevChallenge #14

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

DevChallenge #14

wants to merge 17 commits into from

Conversation

gtoni
Copy link

@gtoni gtoni commented Nov 10, 2018

Improved the game framework, added some new features and fixed some bugs.

Refactored almost every part of the game, the original code was just too coupled and messy,
making the addition of new features harder and more error prone than it should be.
Now it is more modular and organized, improving on orthogonality/separation of concerns.

The player is now able to shoot in all directions.
Made the flying saucers hover in the sky and shoot the player.
Added joystick support for aiming.

Fixed the parallax in the background.
Fixed some bugs caused by collisions & triggers reporting the same game object twice in a frame.

Please check commit history for more details.

Ideas for the future:

  • Make ground enemies navigate and seek the player, while avoiding bombs and bullets.
  • Add inventory system, more weapons and ability to switch them (shotgun would be nice).
  • Ability to charge weapons, such as shooting three rockets at once.
  • Network play with another player
  • A boss enemy

Actors are game objects that have abilities and properties such as health. Actors can be influenced by applying effects.
The ActorEffect class represents the description of the effect to be applied. For now there are only Damage, Kill and Heal effects, but more can be added. Additional properties related to the process of applying the effect can be added as well.
Made separation between character and character controller.
Added Character class which extends Actor and handles generic character abilities.
Added EnemyCharacter and PlayerCharacter classes which take care of specific character properties, such as animations or sounds.
Added PlayerController and EnemyAI, which serve the purpose of driving Characters.
With this, it is now possible to mix and match characters with controllers, making it easier to add other players, or different AIs.
With the ability to hover, the flying sourcer character can be made to fly above and shoot at the player.
Gun replaced by RangedWeapon.
Added a more generic Projectile class.
Added FlyingEnemyAI.
Improved Spawner, now the number of instantiated characters and their type can be controlled. Also added a bit of randomness to spawning interval.
The old parallax was moving the backgrounds in the wrong direction and it was somewhat more confusing.
The backgrounds should not move opposite the camera movement, but along side it with fraction of its displacement.
That way those backgrounds that are at a greater distance will move closely with the camera, appearing to stay still in the distance, while those closer (smaller fraction) will appear to move faster. And the closest one (foreground) is naturally the fastest because it doesn't follow the camera at all.
Also, few small fixes and adjustments
Fixed some null reference exceptions.
Moved the spawners of the green aliens to the platforms on the sides. They no longer randomly drop from the air.
Removed some no longer used properties.
RangedWeapon now looks for a 'muzzle' transform in its hierarchy, which denotes the exit point of the projectile.
Added reloadTime, after the ranged weapon is Fired, it can't be fired again until the amount of time in reloadTime has passed.
Also, the PlayerCharacter now rotates his ranged weapon based on orientation in the range from 45 degrees up to 45 degrees down.
A Hovering Character whose Rigidbody has no linear drag, will now stop in the air after half a second if there is no force applied to it (it will no longer drift endlessly).
The attack interval of the flaying saucers is now configurable.
Since the Player character has two colliders, it may be reported twice through OnTriggerEnter2D in the same frame.
Added minDamageInterval to EnemyCharacter. Enemies now only deal contact damage if they didn't do so for a while.
Fixed few bugs where triggers and collisions were reported twice.
The Cars and Buses on the background are now attached to the 'Bank' background object. This way, they work correctly with the parallax.
LayBombs has been refactored into BombContainer which only keeps track of a number of bombs and their type.
The action of actually dropping a bomb has been moved to Character. As long as a character has a BombContainer and has bombs in it, it can use the drop bomb mechanic.
The Bomb class is no longer responsible for counting bombs or preventing the user from dropping them. It only knows how to explode. (Though for now it is still responsible for triggering the spawning of next Pickup).
Moved the PlayerController, EnemyAI and FlyingEnemyAI to Actor/Controller/ folder.
Moved the BombPickup and HealthPickup to Pickups/ folder.
Renamed HUD/ to UI/
Removed Follow Player.
Added UIHealthbar, which can be placed on or assigned an actor and it will display his health.
Added UICrosshair, which when placed on a character displays that character's orientation.
Added UIBomb, which takes care of showing and hiding the bomb icon, this is no longer a responsibilty of the PlayerCharacter.
Any GameObject that leaves the world boundary gets destroyed
All private variables now start with 'm_'
Also, changed the joystick buttons such that, shooting is done with the right shoulder, droping bombs with the left shoulder and jumping with the 'A' button.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant