Skip to content

-Clean Code And Final Subsmission Commit#7

Open
vijit101 wants to merge 3 commits intomasterfrom
FinalSubmission
Open

-Clean Code And Final Subsmission Commit#7
vijit101 wants to merge 3 commits intomasterfrom
FinalSubmission

Conversation

@vijit101
Copy link
Owner

  • Cleaned some code
  • Added UI
  • Added missing pieces

{
public class ShootingState : TankState
{
bool Enterstate;

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you need this enter state?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the component is disabled when you exit the state - so update won't get called anyways!

{
enemyBehaviour.AddHealth(100);
BulletController EnemyBullet = BulletService.Instance.GetBullet(TankType.LowHealth);
enemyBehaviour.AddHealth((int)EnemyBullet.BulletModel.Damage);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addhealth? function name doesn't seem to be correct - why would you add health to an enemy ? :)

TankModel = tankModel;
// Setting the mdoel to view
TankModel = tankModel; // points to a refrence(address) of tankModel and even if defaultmodel = new tankmodel; default = tank model still points
DefaultModel = new TankModel(tankModel.Type,(int)tankModel.Speed,(int)tankModel.Health);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this default model for?

@@ -0,0 +1,23 @@
using UnityEngine;
using TMPro;
public class EndScoreScript : MonoBehaviour

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to name scripts with the word script

using System.Collections.Generic;
using UnityEngine;

public class SceneSwitcher : MonoBehaviour

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this need to be a monobehaviour ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you even need this script? you can call LevelLoader directly

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.

2 participants