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

Paws-itively awesome! #25

Open
Psydwinder opened this issue Jun 15, 2023 · 0 comments
Open

Paws-itively awesome! #25

Psydwinder opened this issue Jun 15, 2023 · 0 comments

Comments

@Psydwinder
Copy link

Hey team,

Great work on the project, you two have definitely taken on a mammoth of a task trying to code your own version of Space Invaders. But so far it looks great, especially the animation of the villains.

A few things I've noticed are:

  1. The animation for the feet villains jump in frames from one end to the other because of the following code:
@keyframes rotate-animation {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-25deg);
  }
  100% {
    transform: rotate(25deg);
  }
}

But you can make it a smoother animation using the following code

@keyframes rotate-animation {
  0% {
    transform: rotate(25deg);
  }
  50% {
    transform: rotate(-25deg);
  }
  100% {
    transform: rotate(25deg);
  }
}
  1. The villain image leaves the gameboard before it moves to the next line, like this:

image

It might be worth adding in some code here:

function moveForward(allVillains, width) {
  allVillains.forEach((villain) => {
    villain.pos.top === width
      ? console.log("I'M DEAD")
      : (villain.pos.top = villain.pos.top);
  });
}

To prevent it from going outside the gameboard.

  1. The first condition of the following ternary operator doesn't execute even when it hits the bottom of the gameboard:
function moveForward(allVillains, width) {
  allVillains.forEach((villain) => {
    villain.pos.top === width
      ? console.log("I'M DEAD")
      : (villain.pos.top = villain.pos.top);
  });
}

Your project just reminds me of this guy from Mr Deeds.

Feet

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

No branches or pull requests

1 participant